Like i heard that string is immutable mean cannot be changed once created so i tried:

String name = "Hunain";
Console.Write("String_replaced="+  name.Replace('i', 'y') + "\n");

according to someone, string.Replace('','') throws a new object and doesn't modify existing string but it did like in above example, neither i stored it in another object nothing, why ? then what's the difference between string type and string builder ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.