Add formatted string to StringBuilder : StringBuilder : String C# Examples


C# Examples » String » StringBuilder »

 

Add formatted string to StringBuilder









    
using  System;
using  System.Text;

class  MainClass
{
        public  static  void  Main()
        {
                StringBuilder  sb  =  new  StringBuilder();
                int  number  =  1;

                sb.AppendFormat("{0}:  {1}  ",  number++,  "another  string");

                Console.WriteLine("{0}",  sb);
        }
}
    
   
  
   



Output

1: another string


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» StringBuilder