Reputation: 80428
I have some code:
#if SILOG
SiAuto.Main.LogException(ex);
// some other lines
#endif
What would be the easiest way to remove surrounding #if from my entire codebase, i.e., end up with just:
SiAuto.Main.LogException(ex);
I'm using Visual Studio 2010. I'll accept the first answer that I can test to see if it works. Looking forward to your ideas!
Upvotes: 0
Views: 92
Reputation: 128
Assuming your codebase is all in one solution file, and you don't have nested preprocessor directives, You can do a find and replace with a regexp:
\#if SILOG{(.*\n)@}\#endif
For the replacement string, use this:
\1
Make sure have are using the "Regular expressions" find option checked.
Step by step:
This won't fix the indentation of the code that was between the #if / #endif, however.
Upvotes: 1