Struct SpanWordEnumerator
An enumerator for retrieving word-boundary segments from a ReadOnlySpan<T>.
Implements the Unicode Word Boundary Algorithm. UAX #29
https://www.unicode.org/reports/tr29/
Methods are pattern-matched by compiler to allow using foreach pattern.
public ref struct SpanWordEnumerator
- Inherited Members
Constructors
SpanWordEnumerator(ReadOnlySpan<char>)
Initializes a new instance of the SpanWordEnumerator struct.
public SpanWordEnumerator(ReadOnlySpan<char> source)
Parameters
sourceReadOnlySpan<char>The buffer to read from.
Properties
Current
Gets the element in the collection at the current position of the enumerator.
public readonly WordSegment Current { get; }
Property Value
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
public readonly SpanWordEnumerator GetEnumerator()
Returns
- SpanWordEnumerator
An enumerator that iterates through the collection.
MoveNext()
Advances the enumerator to the next element of the collection.
public bool MoveNext()