TextElementEnumerator.Current 屬性

定義

取得字串中目前的文字項目。Gets the current text element in the string.

public:
 property System::Object ^ Current { System::Object ^ get(); };
public object Current { get; }
member this.Current : obj
Public ReadOnly Property Current As Object

屬性值

Object

含有字串中目前文字項目的物件。An object containing the current text element in the string.

實作

例外狀況

列舉值位於字串的第一個文字項目之前,或最後一個文字項目之後。The enumerator is positioned before the first text element of the string or after the last text element.

備註

在建立列舉值之後或呼叫之後 ResetMoveNext 必須呼叫,將列舉值前移至字串的第一個文字專案,再讀取的值 CurrentAfter an enumerator is created or after a Reset is called, MoveNext must be called to advance the enumerator to the first text element of the string before reading the value of Current. 否則, Current 會未定義。Otherwise, Current is undefined.

Current 如果最後一次呼叫 MoveNext 傳回 false ,表示字串的結尾,則也會擲回例外狀況。Current also throws an exception if the last call to MoveNext returned false, which indicates the end of the string.

Current 不會移動列舉值的位置,而會連續呼叫來傳回 Current 相同的物件,直到呼叫 MoveNext 或為止 ResetCurrent does not move the position of the enumerator, and consecutive calls to Current return the same object until either MoveNext or Reset is called.

適用於

另請參閱