ReadOnlySpan<T>.GetEnumerator 方法

定义

返回用于此 ReadOnlySpan<T> 的枚举器。Returns an enumerator for this ReadOnlySpan<T>.

public:
 ReadOnlySpan<T>::Enumerator GetEnumerator();
public ReadOnlySpan<T>.Enumerator GetEnumerator ();
member this.GetEnumerator : unit -> ReadOnlySpan<'T>.Enumerator
Public Function GetEnumerator () As ReadOnlySpan(Of T).Enumerator

返回

ReadOnlySpan<T>.Enumerator

用于此只读范围的枚举器。An enumerator for this read-only span.

注解

GetEnumerator您可以使用 c # foreach 语句和 Visual Basic For Each ... Next 构造来枚举 ReadOnlySpan<T> ,而不是直接调用方法。Instead of calling the GetEnumerator method directly, you can use the C# foreach statement and the Visual Basic For Each...Next construct to enumerate a ReadOnlySpan<T>.

适用于