Use the Append() method to append two strings, an int, and a bool to StringBuilder : StringBuilder : String C# Examples


C# Examples » String » StringBuilder »

 

Use the Append() method to append two strings, an int, and a bool to StringBuilder









    
using  System;
using  System.Text;

class  MainClass
{
    public  static  void  Main()
    {
        StringBuilder  myStringBuilder  =  new  StringBuilder();
        
        myStringBuilder.Append("myString");
        myStringBuilder.Append("  ...  ");
        int  myInt  =  1234;
        myStringBuilder.Append(myInt);
        bool  myBool  =  true;
        myStringBuilder.Append(myBool);


        Console.WriteLine(myStringBuilder);
    }
}
    
   
  
   



Output

myString ... 1234True


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» StringBuilder