is there a way to use tr/// (or equivalent) in java?

后端 未结 3 428
醉话见心
醉话见心 2020-12-06 16:21

I would like to know if there is an equivalent to tr/// (as used in Perl) in Java. For example, if I wanted to replace all \"s\"s with \"p\"s in \"mississippi\" and vice ver

3条回答
  •  广开言路
    2020-12-06 17:05

    Commons' replaceChars may be your best bet. AFAIK there's no replacement (ar ar) in the JDK.

提交回复
热议问题