Iterator
@frozen struct Iterator
@frozen struct Iterator
import Swift
@frozen struct UnicodeScalarView
A view of a string’s contents as a collection of Unicode scalar values.
@frozen struct String
A Unicode string value that is a collection of characters.
init()
Creates an empty view instance.
var customMirror: Mirror { get }
Returns a mirror that reflects the Unicode scalars view of a string.
var debugDescription: String { get }
var description: String { get }
var endIndex: String.UnicodeScalarView.Index { get }
The “past the end” position—that is, the position one greater than the last valid subscript argument.
var startIndex: String.UnicodeScalarView.Index { get }
The position of the first Unicode scalar value if the string is nonempty.
subscript(r: Range<String.UnicodeScalarView.Index>) -> String.UnicodeScalarView.SubSequence { get }
subscript(position: String.UnicodeScalarView.Index) -> Unicode.Scalar { get }
Accesses the Unicode scalar value at the given position.
mutating func append(_ c: Unicode.Scalar)
Appends the given Unicode scalar to the view.
mutating func append<S>(contentsOf newElements: S) where S : Sequence, S.Element == Unicode.Scalar
Appends the Unicode scalar values in the given sequence to the view.
func distance(from start: String.UnicodeScalarView.Index, to end: String.UnicodeScalarView.Index) -> Int
func index(_ i: String.UnicodeScalarView.Index, offsetBy distance: Int) -> String.UnicodeScalarView.Index
func index(_ i: String.UnicodeScalarView.Index, offsetBy distance: Int, limitedBy limit: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index?
func index(after i: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index
Returns the next consecutive location after i
.
func index(before i: String.UnicodeScalarView.Index) -> String.UnicodeScalarView.Index
Returns the previous consecutive location before i
.
func makeIterator() -> String.UnicodeScalarView.Iterator
mutating func replaceSubrange<C>(_ subrange: Range<String.UnicodeScalarView.Index>, with newElements: C) where C : Collection, C.Element == Unicode.Scalar
Replaces the elements within the specified bounds with the given Unicode scalar values.
mutating func reserveCapacity(_ n: Int)
Reserves enough space in the view’s underlying storage to store the specified number of ASCII characters.
typealias Index = String.Index
typealias SubSequence = Substring.UnicodeScalarView
var customPlaygroundQuickLook: _PlaygroundQuickLook { get }
protocol IteratorProtocol<Element>
A type that supplies the values of a sequence one at a time.
protocol Sendable
mutating func next() -> Unicode.Scalar?