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

# Accessing Indicies Within an Attributed Substring

## Topics

### Accessing Terminal Indices

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

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

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

A substring’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 Indices 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)