Following steps are to find blank lines and replace:
In visual studio 2012.
1. Press “ Ctrl+ Shift + H “.
And window shown like:
2. Write regular expression For (vs2012) “^(?([^\r\n])\s)*\r?$\r?\n” or for vs 2010 (^$\n or ^&\n)in find what box.
3. Leave Replace with box as empty.
4. In find check Use Regular Expressions.
Then Replace or Replace all as you want.
These steps will remove all blank spaces from current document or whole project as you chooseLook in box.
Other regular expressions are predefined by visual studio as in below image.(or can see by (a)+ button on find what box).