SpanRuneEnumerator SpanRuneEnumerator SpanRuneEnumerator SpanRuneEnumerator Struct


提供由包含 UTF-16 文字之範圍代表的 Rune 值的列舉程式。Provides an enumerator for the Rune values represented by a span containing UTF-16 text.

public value class SpanRuneEnumerator
public struct SpanRuneEnumerator
type SpanRuneEnumerator = struct
Public Structure SpanRuneEnumerator


這個類型不能直接由應用程式代碼參考。This type is not intended to be referenced directly by application code. 相反地, 請EnumerateRunes使用方法以及語言特定的列舉結構來列舉Rune範圍內的值。Instead, use the EnumerateRunes method along with language-specific enumeration constructs to enumerate Rune values within spans.

foreach for each語言的語句 (在 Visual Basic 中C++ )會隱藏枚舉器的複雜度。For Each C#The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of enumerators. 因此,建議您使用 foreach,而不要直接使用列舉值。Therefore, using foreach is recommended, instead of directly manipulating the enumerator.


Current Current Current Current

取得位於目前列舉程式位置的 RuneGets the Rune at the current position of the enumerator.


GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回目前的列舉程式執行個體。Returns the current enumerator instance.

MoveNext() MoveNext() MoveNext() MoveNext()

將列舉程式前移至範圍的下一個 RuneAdvances the enumerator to the next Rune of the span.