<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/accessing-indicies-within-an-attributed-string",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Accessing Indicies Within an Attributed String"
}
-->

# Accessing Indicies Within an Attributed String

Access a position within an attributed string, offset from the beginning, or before or after another known position.

## Topics

### Accessing Terminal Indices

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

The position of the first character in a nonempty attributed 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.

### Accessing Indices by Offset

### Accessing Indices Before a Known Position

### Accessing Indicies After a Known Position

### Supporting Types

[`struct Index`](/documentation/Foundation/AttributedString/Index)

A type that represents the position of a character or code unit within an attributed string.



---

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)