Using eclipse find and replace all to swap arguments

后端 未结 5 563
夕颜
夕颜 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 21:03

    search for

    assertEquals\((.*),\s*(.*)\);

    and replace with

    assertEquals(\2, \1);

    Sorry for the more or less superflous answer. But it does work better for me and I think for others as well. My edit of the first post was rejected.

提交回复
热议问题