Replace multiple substrings at once

前端 未结 5 1569
予麋鹿
予麋鹿 2020-12-05 20:56

Say I have a file, that contains some text. There are substrings like \"substr1\", \"substr2\", \"substr3\" etc. in it. I need to replace all of those substrings with some o

5条回答
  •  臣服心动
    2020-12-05 21:21

        return yourString.replaceAll("substr1","relp1").
                         replaceAll("substr2","relp2").
                         replaceAll("substr3","relp3")
    

提交回复
热议问题