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 do I need to do string A = stringB.Replace("X","Y")
? I thought it is just a method to be done on specified instance.
EDIT: Thank you so far. I extend my question: Why does b+="FFF"
work but b.Replace
does not?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…