<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributedStringProtocol/characters",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation24AttributedStringProtocolP10charactersAA0bC0V13CharacterViewVvp"
  },
  "title" : "characters"
}
-->

# characters

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

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

## Discussion

Use the [`characters`](/documentation/Foundation/AttributedStringProtocol/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`](/documentation/Foundation/AttributedString) or [`AttributedSubstring`](/documentation/Foundation/AttributedSubstring).

You can also use this property to mutate the attributed string, using <doc://com.apple.documentation/documentation/Swift/RangeReplaceableCollection> methods, such as `insert(_:at:)` and <doc://com.apple.documentation/documentation/Swift/RangeReplaceableCollection/append(_:)>. Inserted characters inherit any attributes present at the insertion point.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)