Removing Vertical White Space

rbulph

Junior Contributor
Joined
Feb 17, 2003
Messages
397
Is there any automated way to cut out all superfluous blank lines from my code, i.e. so that there are never two consecutive blank lines? I've found the "Delete Horizontal White Space" command, but nothing comparable for vertical white space.
 
You could write a quick tool that would do it. Regular expressions would be the way to go. In fact, even easier, maybe a find and replace using regular expressions for consecutive newlines with whitespace only in between would work..
 
mskeel said:
You could write a quick tool that would do it. Regular expressions would be the way to go. In fact, even easier, maybe a find and replace using regular expressions for consecutive newlines with whitespace only in between would work..
Yes, a find and replace would be fine. Find two consecutive new lines with one new line would be good enough. But I don't know how to use regular expressions (I tried downloading a sample included in the help files, but it wouldn't work). Any chance of letting me know what I need to put in the find and replace boxes to do this?
 
The regular expressions used for find and replace are slightly different than the System.Text.Regular expressions and I actually have no idea how they work :(. There should be some help files in the MSDN that can point you in the right direction, though. I have happened across those from time to time when looking for information on the System.Text.Regular expressions.
 
Back
Top