Replace characters : String Insert Replace : String C# Examples


C# Examples » String » String Insert Replace »

 

Replace characters









    
using  System;    
    
class  MainClass  {    
    public  static  void  Main()  {    
        string  str  =  "This  is  a  test";  
  
        Console.WriteLine("Original  string:  "  +  str);  
          
        //  Replace  characters  
        str  =  str.Replace('a',  'X');  
        Console.WriteLine(str);  
  
    }  
}
    
   
  
   



Output

Original string: This is a test
This is X test


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String Insert Replace