I have a C # project in VS2008 that has many lines of code that look like this:
string s = "bla blab" + x + "bla bla bla" + y + .... ;
and I would like to cover these lines with one line using string.Format (...).
I am currently using Resharper 5.0, and I can reorganize one line of code with one click. The problem is that I have more than 1000 lines like this, and I don't want to manually iterate over each line.
Is there any way to do this automatically?
Edit: Since Mark corrected me, I really don't need to do this, but I have another very similar problem: I got this code
string s = "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaa";
(the string is some sql query)
and I would like to reorganize it into one line of const:
string s = "aaaaaaaaaaaaaaaaaa....aaaaa";
(this time itโs more efficient, right?)
resharper can do this automatically in a string, but again, I would like to do this many times.
it would be great to keep the indentation of the lines:
string s = @"aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa";
but only one long line is also ok.
thank you Leo.