← Standard library

CharIterator

scoped struct CharIterator
import CharIterator from Wax;

A scoped iterator over UTF-8 code points. It borrows its byte storage; use HasNext before MoveNext, or consume it through iteration syntax.

String.wax:1588

Members

constructorconstructor

public constructor (ReadOnlySpan<uint8> bytes)

Creates an iterator over the supplied byte view without copying. Character and grapheme iteration expects UTF-8 input.

String.wax:1596

HasNextmethod

public fn HasNext() : bool

Returns whether another element remains without consuming it.

String.wax:1604

MoveNextmethod

public fn MoveNext() : char

Returns the next decoded code point and advances by its byte width. Malformed bytes produce U+FFFD and consume one byte; exhaustion returns U+FFFD.

String.wax:1615

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.