How to batch refactor old multi-line C string into C++11 raw string literal

111 views Asked by At

I have some legacy code with old style C string.

string foo = "blah blah1"
             "blah blah2"
             "blah blah3"
             "blah blah4";

I want to convert all of them into C++11 raw string literal.

string foo = R"(
    blah blah1
    blah blah2
    blah blah3
    blah blah4
)";

Is there some tool/editor/script I can use to batch convert them?

I understand that those two versions are different(the first foo does not have line break, but in my case, I don't care about \n, so they are equivalent.

0

There are 0 answers