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);
}
}
Related examples in the same category