Create a StringBuilder which hold 100 characters. : StringBuilder : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » StringBuilder »

 

Create a StringBuilder which hold 100 characters.








    
 
 
using System;
using System.Text;

class StringApp {
    static void Main(string[] args) {
        StringBuilder myBuffer = new StringBuilder("My string data");
        Console.WriteLine(myBuffer.Capacity);
        myBuffer.Append(" contains some numerical data: ");
        myBuffer.AppendFormat("{0}, {1}.", 44, 99);
        Console.WriteLine(myBuffer.Capacity);
        Console.WriteLine(myBuffer);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» StringBuilder