It works. It just doesn't do what you think: it doesn't edit the existing string
: it creates a new string. Try:
a = a.Replace("=", "r");
a = a.Replace("+", "t");
This is because string
s are immutable: they do not change once created (at least, not if you might be looking - there are some exceptions like the internals of StringBuilder
, but those are implementation details that you shouldn't see)