How do I remove some characters from my String

后端 未结 8 921
无人及你
无人及你 2020-12-17 17:03

i want to remove all of the following chars from my string

\">[],-\"

at the moment im doing this. but there must be a more effic

8条回答
  •  感情败类
    2020-12-17 17:57

    newString = myString.replaceAll("[>\\[\\],-]", "");
    

    The backslashes are to escape the '[' because the first argument is actually a regular expression.

提交回复
热议问题