我想使用.replace函数来替换多个字符串.
我现在有
string.replace("condition1", "")
Run Code Online (Sandbox Code Playgroud)
但是想要有类似的东西
string.replace("condition1", "").replace("condition2", "text")
Run Code Online (Sandbox Code Playgroud)
虽然那感觉不是很好的语法
这样做的正确方法是什么?有点像grep/regex你可以做什么\1,\2并将字段替换为某些搜索字符串