Java: Understanding the String replaceAll() method

前端 未结 2 700
后悔当初
后悔当初 2021-01-02 21:48

I\'m looking to figure out the answer to this problem here.

First off,

blah[abc] = blah[abc].replaceAll(\"(.*) (.*)\", \"$2, $1\");

2条回答
  •  臣服心动
    2021-01-02 22:18

    Your regular expression "(.)(.)" will be of this sort : "(x)(y)" this will be replaced by "$2,$1.

提交回复
热议问题