java - replace a char in String -


Hi, I want to change one to four in the string. My problem is that before you do not know which character it is, so in some cases I get an error message when my four example is for example '+' I do not want to have my four as regex To be defined, what should I do?

May code should be something like this:

  string test = "something"; char ca = input.chatAt (0); Input = input.replaceAll ("" + ca, "");   

I hope you can help me.

just don 'then use regex.

  input = input.replace (String.valueOf (ca), "");   

copying all method string takes a string representation of a regular expression as an argument.

Change is not the method.

View.

Comments

Popular posts from this blog

c# - Roxy file manager in MVC doesn't accept session path -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -