<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributedString/AttributedStringProtocol-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "AttributedStringProtocol Implementations"
}
-->

# AttributedStringProtocol Implementations

## Topics

### Instance Properties

[`var characters: AttributedString.CharacterView`](/documentation/Foundation/AttributedString/characters)

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

[`var endIndex: AttributedString.Index`](/documentation/Foundation/AttributedString/endIndex)

The string’s past-the-end position — the position one greater than the last valid subscript argument.

[`var runs: AttributedString.Runs`](/documentation/Foundation/AttributedString/runs-swift.property)

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

[`var startIndex: AttributedString.Index`](/documentation/Foundation/AttributedString/startIndex)

The position of the first character in a nonempty attributed string.

[`var unicodeScalars: AttributedString.UnicodeScalarView`](/documentation/Foundation/AttributedString/unicodeScalars)

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

[`var utf16: AttributedString.UTF16View`](/documentation/Foundation/AttributedString/utf16)

A view of the attributed string’s contents as a collection of UTF-16 code units.

[`var utf8: AttributedString.UTF8View`](/documentation/Foundation/AttributedString/utf8)

A view of the attributed string’s contents as a collection of UTF-8 code units.

### Subscripts

[`subscript(some RangeExpression<AttributedString.Index>) -> AttributedSubstring`](/documentation/Foundation/AttributedString/subscript(_:)-2vqsz)

Returns a substring of the attributed string using a range to indicate the substring bounds.

[`subscript<K>(dynamicMember _: KeyPath<AttributeDynamicLookup, K>) -> K.Value?`](/documentation/Foundation/AttributedString/subscript(dynamicMember:)-34zdf)

Returns an attribute value that a key path indicates.

[`subscript<S>(dynamicMember _: KeyPath<AttributeScopes, S.Type>) -> ScopedAttributeContainer<S>`](/documentation/Foundation/AttributedString/subscript(dynamicMember:)-9modq)

Returns a scoped attribute container that a key path indicates.

---

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)