---
title: string
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsattributedstring/string
---

# string

The character contents of the attributed string as a string.

## Declaration

```swift
var string: String { get }
```

## Discussion

Discussion Attachment characters are not removed from the value of this property. For performance reasons, this property returns the current backing store of the attributed string object. If you want to maintain a snapshot of this as you manipulate the returned string, you should make a copy of the appropriate substring. This primitive property must guarantee efficient access to an attributed string’s characters; subclasses should implement it to execute in O(1) time.

## See Also

### Getting the characters

- [length](foundation/nsattributedstring/length.md)
- [attributedSubstring(from:)](foundation/nsattributedstring/attributedsubstring(from:).md)
