Char : Char : Data Type C# Examples


C# Examples » Data Type » Char »

 

Char









    
using  System;    
    
class  MainClass  {          
    public  static  void  Main()  {          
        string  str  =  "This  is  a  test.  $23";  
        int  i;  
  
        for(i=0;  i  <  str.Length;  i++)  {  
            Console.Write(str[i]  +  "  is");  
            if(Char.IsPunctuation(str[i]))  
                Console.Write("  punctuation");  
  
            Console.WriteLine();  
        }  
    }
}
    
   
  
   



Output

T is
h is
i is
s is
  is
i is
s is
  is
a is
  is
t is
e is
s is
t is
. is punctuation
  is
$ is
2 is
3 is


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Char