Use the Remove() method to remove part of StringBuilder : StringBuilder : String C# Examples


C# Examples » String » StringBuilder »

 

Use the Remove() method to remove part of StringBuilder









    
using  System;
using  System.Text;

class  MainClass
{
    public  static  void  Main()
    {
        StringBuilder  myStringBuilder  =  new  StringBuilder();
        myStringBuilder.Append("friends");
        
        myStringBuilder.Insert(2,  "friends,  ");
        myStringBuilder.Insert(2,  "Romans,  ",  3);
        Console.WriteLine("myStringBuilder  =  "  +  myStringBuilder);

        
        myStringBuilder.Remove(4,  7);
        Console.WriteLine("myStringBuilder  =  "  +  myStringBuilder);

    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» StringBuilder