Table of Contents

Struct SpanWordEnumerator

Namespace
SixLabors.Fonts.Unicode
Assembly
SixLabors.Fonts.dll

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

source ReadOnlySpan<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

WordSegment

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()

Returns

bool

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.