Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextElementEnumerator.Current Property

 

Gets the current text element in the string.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public object Current { get; }

Property Value

Type: System.Object

An object containing the current text element in the string.

Exception Condition
InvalidOperationException

The enumerator is positioned before the first text element of the string or after the last text element.

After 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. Otherwise, Current is undefined.

Current also throws an exception if the last call to MoveNext returned false, which indicates the end of the string.

Current does not move the position of the enumerator, and consecutive calls to Current return the same object until either MoveNext or Reset is called.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft