为了账号安全,请及时绑定邮箱和手机立即绑定

Java不能用replaceAll方法替换“{”

Java不能用replaceAll方法替换“{”

慕的地8271018 2021-06-21 17:59:10
我们正在使用 String 的 replaceAll 方法,我们不能在任何字符串中替换 { 。我们的例子:试过:"some { string".replaceAll("{", "other string");错误如下:java.util.regex.PatternSyntaxException:发生非法重复对任何想法持开放态度!也许有解决方法?!
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 315 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信