Struct SpanGraphemeEnumerator
An enumerator for retrieving Grapheme instances from a ReadOnlySpan<T>.
Implements the Unicode Grapheme Cluster Algorithm. UAX:29
https://www.unicode.org/reports/tr29/
Supports the UAX #29 extended grapheme cluster rule for Indic conjunct sequences
(GB9c) using the IndicConjunctBreakClass property.
Methods are pattern-matched by compiler to allow using foreach pattern.
public ref struct SpanGraphemeEnumerator
- Inherited Members
Constructors
SpanGraphemeEnumerator(ReadOnlySpan<char>)
Initializes a new instance of the SpanGraphemeEnumerator struct.
public SpanGraphemeEnumerator(ReadOnlySpan<char> source)
Parameters
sourceReadOnlySpan<char>The buffer to read from.
SpanGraphemeEnumerator(ReadOnlySpan<char>, TerminalWidthOptions)
Initializes a new instance of the SpanGraphemeEnumerator struct.
public SpanGraphemeEnumerator(ReadOnlySpan<char> source, TerminalWidthOptions terminalWidthOptions)
Parameters
sourceReadOnlySpan<char>The buffer to read from.
terminalWidthOptionsTerminalWidthOptionsThe terminal width options to apply while enumerating.
Properties
Current
Gets the element in the collection at the current position of the enumerator.
public readonly GraphemeCluster Current { get; }
Property Value
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
public readonly SpanGraphemeEnumerator GetEnumerator()
Returns
- SpanGraphemeEnumerator
An enumerator that iterates through the collection.
MoveNext()
Advances the enumerator to the next element of the collection.
public bool MoveNext()