Replace all method throws PatternSyntaxException

后端 未结 1 1657
悲&欢浪女
悲&欢浪女 2020-12-12 07:51

look at the following code:

String comment = \"1)FCR pick up in Hong Kong2)Local charges will be paiy in Hong Kong & in HK$.3)Booking:virginiawong@fahkc         


        
相关标签:
1条回答
  • 2020-12-12 08:26

    String.replaceAll usess regular expressions for the first argument, and characters such as ) have special meaning when interpreted as regular expressions.

    Try String.replace instead. (It still replaces all occurrences of the given substring.)

    0 讨论(0)
提交回复
热议问题