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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -