yanan7890

开始想到String.replaceFirst(regex, replacement)和String.replaceAll(regex, replacement);

但特殊字符没替换成功。

用法:StringUtils.replace("目标字符串","需要替换的内容","替换成的内容");

public static void main(String[] args) {
String t="asdf#{}sadf;kal#{}";
System.out.println(t.indexOf("#{}"));
String replace = StringUtils.replaceOnce(t,"#{}","<input>");
System.out.println(replace);
}

参考https://zhidao.baidu.com/question/1575809481137449380.html

分类:

技术点:

相关文章:

  • 2021-07-14
  • 2021-10-03
  • 2021-10-03
  • 2021-11-01
  • 2021-10-15
  • 2021-11-23
  • 2021-08-07
猜你喜欢
  • 2021-10-03
  • 2021-07-17
  • 2021-10-03
  • 2022-01-15
  • 2022-01-11
  • 2022-12-23
  • 2022-01-02
相关资源
相似解决方案