string stringbuilder c#

37

string stringbuilder c# -

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

string stringbuilder c# -

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"

Comments

Submit
0 Comments