I have a bunch of assignment operations in Visual Studio, and I want to reverse them:
i.e
i = j;
would become
j = i;
i.e. replacing everything before the equals with what's after the equals, and vice versa
Is there any easy way to do this, say something in the regular expression engine?
Select the lines you want to swap, Ctrl+H, then replace:
with:
with “Look in:” set to “Selection”
That only handles C/C++ style identifiers, though (via the “:i”). Replace that with:
to replace anything on either side of the “=”.
Also, since you mentioned in a comment you use ReSharper, you can just highlight the “=”, Alt+Enter, and “Reverse assignment”.