How to delete blank lines from code in Netbeans

Formatting in Netbeans will not delete all the blank lines and sometimes we want this. For example, when the charset is messed up and the blank spaces are doubled because CR and LF – Unix – Windows compatibility.

Solution: Ctrl-F (find) in Netbeans as Regular Expression:

\n\s*(\n)

and Replace All by

$1

A special thanks to http://seo.911web.org/netbeans-how-to-delete-blank-lines

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: