Get Text Element Enumerator : String Info « Development Class « C# / C Sharp






Get Text Element Enumerator

Get Text Element Enumerator

using System;
using System.Globalization;
using System.Threading;

class Class1 {
  static void Main(string[] args) {
         TextElementEnumerator Iter;
         String MyStr, OutBuf;

         MyStr = "The Quick programmer ran rings around the lazy manager";

         //Lets do the iterator thing
         Iter = StringInfo.GetTextElementEnumerator(MyStr);
         while (Iter.MoveNext())
         {
            OutBuf = "Character at position " + 
                     Iter.ElementIndex.ToString() + 
                     " = " + Iter.Current;
            Console.WriteLine(OutBuf);
         }
   }
}

           
       








Related examples in the same category

1.Get Next Text ElementGet Next Text Element