---
title: "init(string:attributes:range:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nstextlinefragment/init(string:attributes:range:)"
---

# init(string:attributes:range:)

Creates a new line fragment using the string, attributes, and range you provide.

## Declaration

```swift
convenience init(string: String, attributes: [NSAttributedString.Key : Any] = [:], range: NSRange)
```

## Parameters

- `string`: An attributed string.
- `attributes`: A dictionary of attributes.
- `range`: The range to use from string.

## See Also

### Creating line fragments

- [init(attributedString:range:)](appkit/nstextlinefragment/init(attributedstring:range:).md)
- [init(coder:)](appkit/nstextlinefragment/init(coder:).md)
