Alternative to successive String.replace

后端 未结 7 1069
無奈伤痛
無奈伤痛 2020-12-14 07:10

I want to replace some strings in a String input :

string=string.replace(\"

\",\"\"); string=string.replac

7条回答
  •  执念已碎
    2020-12-14 07:20

    StringBuilder is backed by a char array. So, unlike String instances, it is mutable. Thus, you can call indexOf() and replace() on the StringBuilder.

提交回复
热议问题