Get characters in a string : Char : Data Type C# Examples


C# Examples » Data Type » Char »

 

Get characters in a string









    
using  System;

class  Test{
        public  static  void  Main()
        {
                string  s  =  "Test  String";
                
                for  (int  index  =  0;  index  <  s.Length;  index++)
                      Console.WriteLine("Char:  {0}",  s[index]);
        }
}
    
   
  
   



Output

Char: T
Char: e
Char: s
Char: t
Char:
Char: S
Char: t
Char: r
Char: i
Char: n
Char: g


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Char