GetEnumerator Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Returns an enumerator that can be used to iterate through the collection.
Syntax
public TextCharCollection.TextCharEnumerator GetEnumerator();Public Function GetEnumerator() As TextCharCollection.TextCharEnumeratorReturn Value
The return value is an IEnumerator that represents the collection.
Examples
The following example works with text chars in the current document by using TextCharCollection.GetEnumerator.
TextCharCollection textCharCollection = textControl.TextChars;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
IEnumerator enumerator = textCharCollection.GetEnumerator();
while (enumerator.MoveNext())
{
TextChar textChar = (TextChar)enumerator.Current;
Console.WriteLine(textChar);
}Dim textCharCollection As TextCharCollection = textControl.TextChars
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim enumerator As IEnumerator = textCharCollection.GetEnumerator()
While enumerator.MoveNext()
Dim textChar As TextChar =
DirectCast(enumerator.Current, TextChar)
Console.WriteLine(textChar)
End While