I have a lot of lines like this in my program,
Current[0][1] - CILH.Offset;
Now I have to change all of them to:
this.Offset(Current[0][1], CILH.Offset);
Do I have to manually change this or there is some function or smart stuff in visual studio that can do this?
UPDATE
ok here is teh story, I have lines like this
double something0 = Current[0][1] - CILH.Offset; //both vars on right side are doubles
double something1 = Current[1][1] - CILH.Offset;
double something2 = Current[2][1] - CILH.Offset;
I had some problems so I decided to pass both right side doubles to a method and use the method instead:
private void Offset(double val, double off)
{
if(off == 0) return val;
else if(val == 0) return off;
else return val + off;
}
Now I have to change all lines to something like this:
double something0 = Offset(Current[0][1], CILH.Offset);
double something1 = Offset(Current[1][1], CILH.Offset);
double something2 = Offset(Current[2][1], CILH.Offset);
This is insane for hundred lines like this 🙁
You may use regular expression for this you can look here for more details