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

Popular posts from this blog

google app engine - 403 Forbidden POST - Flask WTForms -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -

how to run a query SQL in node.js mysql -