Now I have a bit more complicated task.
In my example there is a loop "header" that is in 3 lines, and I need it only in
1 line.
The original text:
string something="";
bool anything=true;
for(int i=0;
i<var1;
i++)
{
string nothing=text[i];
}
I want the
for(int i=0; i<var1; i++) in 1 line.
Important: I need it in a
general formula, so eg. it can be either
for(int var2=x; var2<var3; var2++) or
for(int var4=100; var4>=var1; var4--) and similar ...
By using this regex
for\s*\([^\n]+\n[^\n]+\n[^\n]+ I can get the loop "header", but I don't know how could I get the result without those 2
\n (highlighted with orange).
Any help?