xxxxxxxxxx
string s="hi";
//now let s be address 1000
s+=" there";
//above concatination causes creation of new instance in address location other than 1000
//with modified value "hi there"
xxxxxxxxxx
StringBuilder bld = new StringBuilder();
for (int i = 0; i < arrayOfStrings.Length; ++i)
{
bld.Append(arrayOfStrings[i]);
}
string str = bld.ToString();
xxxxxxxxxx
StringBuilder sbr = new StringBuilder("My Favourite Programming Font is ");
sbr.Append("Inconsolata")
//append operation only modifies existing instance of sbr rather than creating new instance
xxxxxxxxxx
StringBuilder sb = new StringBuilder();
sb.Append("Ola~");
sb.Append("Jola~");
sb.Append("Zosia~");
//foreach loop ver sb object
foreach(string s in sb.ToString().Split('~')){
Console.WriteLine(s);
}