Why string.Replace("X","Y") works only when assigned to new string?
- by Petr
Hi,
I guess it has to do something with string being a reference type but I dont get why simply string.Replace("X","Y") does not work?
Why I need to do `string A=stringB.Replace("X","Y")
I thought it is just a method to be done on specified instance? Thanks for explanation
EDIT: Thank you so far. I extend my question Why "b+="FFF"works but the b.replace is not?