StringBuilder.ChunkEnumerator 結構

定義

支援簡單反覆處理 StringBuilder 執行個體區塊。Supports simple iteration over the chunks of a StringBuilder instance.

public: value class StringBuilder::ChunkEnumerator
public struct StringBuilder.ChunkEnumerator
type StringBuilder.ChunkEnumerator = struct
Public Structure StringBuilder.ChunkEnumerator
繼承
StringBuilder.ChunkEnumerator

備註

ChunkEnumerator方法會傳回 StringBuilder.GetChunksA ChunkEnumerator is returned by the StringBuilder.GetChunks method. 它支援 IEnumerable 和模式, IEnumerator 讓您可以使用 foreach c # 或 Visual Basic 來列舉區塊 For EachIt supports both the IEnumerable and IEnumerator patterns so that the chunks can be enumerated with foreach in C# or For Each in Visual Basic.

ChunkEnumerator 是公用結構,因此語言編譯器可以使用它來建立 foreach 語句。ChunkEnumerator is a public structure so that language compilers can use it to build a foreach statement. 不過,開發人員通常不會明確地使用它 (這也是) 的巢狀型別。However, developers typically don't use it explicitly (which is why it is a nested type).

屬性

Current

取得集合目前位置的區塊。Gets the chunk and the current position of the collection.

方法

GetEnumerator()

提供傳回 this 作為 IEnumeratorGetEnumerator() 實作。Provides an GetEnumerator() implementation that returns this as the IEnumerator.

MoveNext()

將列舉值前移至集合中的下一個區塊。Advances the enumerator to the next chunk in the collection.

適用於