Questions tagged «backslash»


5
String.replace所有单反斜杠和双反斜杠
我正在尝试将转换String \something\为String \\something\\using replaceAll,但是我不断遇到各种错误。我认为这是解决方案: theString.replaceAll("\\", "\\\\"); 但这给出了以下异常: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.