---
title: "init(string:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsattributedstring/init(string:)"
---

# init(string:)

Creates an attributed string with the specified text and no attribute information.

## Declaration

```swift
init(string str: String)
```

## Parameters

- `str`: The text for the new attributed string.

## Return Value

Return Value An NSAttributedString object initialized with the characters of str and no attribute information.

## See Also

### Related Documentation

- [init(RTF:documentAttributes:)](foundation/nsattributedstring/init(rtf:documentattributes:).md)
- [Attributed String Programming Guide](apple-archive/documentation/Cocoa/Conceptual/AttributedStrings.md)

### Creating from another string

- [init(string:attributes:)](foundation/nsattributedstring/init(string:attributes:).md)
- [init(attributedString:)](foundation/nsattributedstring/init(attributedstring:).md)
