Java best way for string find and replace?

后端 未结 7 1511
一生所求
一生所求 2021-02-03 21:38

I\'m looking for the best approach for string find and replace in Java.

This is a sentence: \"My name is Milan, people know me as Milan Vasic\".

I want to repla

7条回答
  •  自闭症患者
    2021-02-03 22:16

    Simply include the Apache Commons Lang JAR and use the org.apache.commons.lang.StringUtils class. You'll notice lots of methods for replacing Strings safely and efficiently.

    You can view the StringUtils API at the previously linked website.

    "Don't reinvent the wheel"

提交回复
热议问题