java - Error replacing '+' , '-' , '*' , '/' -
what have put replace "+"?
if (msg.contains("+")){ msg.replace("+", "###%sum%###"); }
string immutable in java:
msg = msg.replace("+", "###%sum%###");
replace()
not modify msg
, instead returning new string object.
Comments
Post a Comment