Using eclipse find and replace all to swap arguments

后端 未结 5 564
夕颜
夕颜 2021-02-07 20:46

I have about 100 lines that look like the below:

assertEquals(results.get(0).getID(),1);

They all start with assertEquals and contain two arguments. Im looking f

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-07 20:49

    I don't know how to do it in Eclipse, but if you happen to also have a vim installed you might load your file in it and do

    :%s/\(assertEquals(\)\(.*\),\(.*\))/\1\3,\2)/
    

提交回复
热议问题