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

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

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