Convert character to upper case : Char : Data Type C# Examples


C# Examples » Data Type » Char »

 

Convert character to upper case









    
using  System;    
    
class  MainClass  {          
    public  static  void  Main()  {          
        string  str  =  "This  is  a  test.  $23";  
  
        Console.WriteLine("Original:  "  +  str);  
  
        //  .        
        string  newstr  =  "";  
        for(int  i=0;  i  <  str.Length;  i++)  
            newstr  +=  Char.ToUpper(str[i]);  
    
        Console.WriteLine("Uppercased:  "  +  newstr);  
    }          
}
    
   
  
   



Output

Original: This is a test. $23
Uppercased: THIS IS A TEST. $23


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Char