我想用replace函数替换字符串的多个子串。
string.replace("condition1", "")
但我想要的是
string.replace("condition1", "").replace("condition2", "text")
虽然这感觉不像是好的语法。有没有更好的方法,就像grep/regex中的用\1和\2将字段替换为某些字符串
\1
\2
相似问题