---
title: characters
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/attributedstring/characters
---

# characters

The characters of the attributed string, as a view into the underlying string.

## Declaration

```swift
var characters: AttributedString.CharacterView { get set }
```

## Discussion

Discussion Use the characters view when you want to look for specific string content. You can then use the resulting ranges to set attributes for specific parts of the AttributedString. You can also use this property to mutate the attributed string, using RangeReplaceableCollection methods, such as insert(_:at:) and append(_:). Inserted characters inherit any attributes present at the insertion point.

## See Also

### Accessing Views into the Attributed String

- [AttributedString.CharacterView](foundation/attributedstring/characterview.md)
- [unicodeScalars](foundation/attributedstring/unicodescalars.md)
- [AttributedString.UnicodeScalarView](foundation/attributedstring/unicodescalarview.md)
- [runs](foundation/attributedstring/runs-swift.property.md)
- [AttributedString.Runs](foundation/attributedstring/runs-swift.struct.md)
