---
title: String.Iterator
framework: swift
role: symbol
role_heading: Structure
path: swift/string/iterator
---

# String.Iterator

A type that provides the collection’s iteration interface and encapsulates its iteration state.

## Declaration

```swift
@frozen struct Iterator
```

## Overview

Overview By default, a collection conforms to the Sequence protocol by supplying IndexingIterator as its associated Iterator type.

## Topics

### Instance Methods

- [next()](swift/string/iterator/next().md)

### Type Aliases

- [String.Iterator.Element](swift/string/iterator/element.md)

## Relationships

### Conforms To

- [IteratorProtocol](swift/iteratorprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Related String Types

- [Substring](swift/substring.md)
- [StringProtocol](swift/stringprotocol.md)
- [String.Index](swift/string/index.md)
- [String.UnicodeScalarView](swift/string/unicodescalarview.md)
- [String.UTF16View](swift/string/utf16view.md)
- [String.UTF8View](swift/string/utf8view.md)
- [String.Encoding](swift/string/encoding.md)
