String Capacity: In the example below somehow I could not make EnsureCapacity property more visible/ensured with output, however I was able to adjust the capacity without any problem.

string_capacity.cs

//stringbuler
//csc string_capacity.cs
using System;
using System.Text;
namespace ex_stringbuild
{


class buildstring
{
public void mystrbuilder(string f, string l, string id)
{
//Strinbuilder class in found in System.Text namespace
System.Text.StringBuilder str = new System.Text.StringBuilder();

//StrindBuilder str = new StrindBuilder();
str.Append(f);
str.Append(l);
str.Append(id);
Console.WriteLine("Capacity of str is: " + str.Capacity);
Console.WriteLine("Current Length is: " +str.Length );
int n = str.Length;
//str.EnsureCapacity(n);
int n2 = str.EnsureCapacity(50);
Console.WriteLine("Ensure of str is: " + str.Capacity + "---" + n2);
Console.WriteLine("New Capacity of str is set to exact length: " + str.Capacity);
str.Capacity = 75;
Console.WriteLine("New Capacity of str readjusted to : " + str.Capacity);
for(int i = 0; i <str.Length; i++)
// Console.WriteLine("Reading original String : " );
Console.Write( str[i]);
Console.WriteLine();
Console.WriteLine("----Replace a with o---- ");
str.Replace("a","o");
for(int i = 0; i <str.Length; i++)
Console.Write(str[i]);
Console.WriteLine();
Console.WriteLine(" just pausing press anykey");

}
}
class test
{
static void Main(string[] args)
{
buildstring ss = new buildstring();
ss.mystrbuilder("Manas","Mukherjee", "12345");
Console.ReadLine();
}
}
}