nvm, the following code prints true for s1 = "test" and false for "test "
string s1 = "test";
string s2 = s1.Trim();
Console.WriteLine(object.ReferenceEquals(s1, s2));
Type: Posts; User: KIBO
nvm, the following code prints true for s1 = "test" and false for "test "
string s1 = "test";
string s2 = s1.Trim();
Console.WriteLine(object.ReferenceEquals(s1, s2));
strings are immutable classes, fine
but consider the Trim function. What happens when Trim finds out theres nothing to trim. Will it do just "return this" or "return new string(this)"
??