Click here to Skip to main content
15,879,348 members
Articles / Web Development / ASP.NET
Tip/Trick

Remove blank lines from code in Visual Studio

Rate me:
Please Sign up or sign in to vote.
4.77/5 (52 votes)
13 Oct 2010CPOL 117K   30   31
1. Click Ctrl+H (quick replace)
2. Tick "Use Regular Expressions"
3. In Find specify "^$\n"
4. In Replace box delete everything.
5. Click "Replace All"
All Blank lines will be deleted. :)
^ Means Beginning of line
$ Means End of line

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionApplicable To Pin
maitrey6841-Jul-13 23:03
professionalmaitrey6841-Jul-13 23:03 
QuestionThnx Pin
Remya Viswan26-Feb-13 17:56
Remya Viswan26-Feb-13 17:56 
GeneralMy vote of 5 Pin
Renju Vinod12-Dec-12 19:39
professionalRenju Vinod12-Dec-12 19:39 
SuggestionIncluding spaces Pin
Mika2-Oct-12 23:20
Mika2-Oct-12 23:20 
GeneralMy vote of 5 Pin
Koshy Panicker John16-Sep-12 20:11
Koshy Panicker John16-Sep-12 20:11 
GeneralReason for my vote of 5 i wish i read this an hour ago. i ha... Pin
A. Duman27-Oct-11 21:47
A. Duman27-Oct-11 21:47 
GeneralWorking. My vote of 5 Pin
Syed Shabeer25-Oct-11 2:05
Syed Shabeer25-Oct-11 2:05 
GeneralReason for my vote of 5 Reason for my vote of 5 Good one Pin
RaviRanjanKr21-Jul-11 9:27
professionalRaviRanjanKr21-Jul-11 9:27 
GeneralReason for my vote of 5 Very helpful Dave!!! Came to know ab... Pin
Jyothikarthik_N14-Jul-11 23:26
Jyothikarthik_N14-Jul-11 23:26 
GeneralIt is great,Thank you Pin
Eric Yin 201216-May-11 0:08
Eric Yin 201216-May-11 0:08 
GeneralReason for my vote of 4 good .. thank you for the informatio... Pin
ahsan sarfraz24-Jan-11 0:15
ahsan sarfraz24-Jan-11 0:15 
GeneralReason for my vote of 5 Short and effective solution Pin
sign zala5-Nov-10 13:57
sign zala5-Nov-10 13:57 
GeneralReason for my vote of 1 Your posted solution does not work i... Pin
Your Display Name Here5-Nov-10 4:26
Your Display Name Here5-Nov-10 4:26 
GeneralReason for my vote of 4 It's good, helpful. Pin
NirdeshSaini27-Oct-10 4:07
NirdeshSaini27-Oct-10 4:07 
GeneralReason for my vote of 4 Small and Powerfull... Piyush_mca@ya... Pin
piyush2125-Oct-10 18:01
piyush2125-Oct-10 18:01 
GeneralReason for my vote of 1 What's new here ? Pin
Yet Another XCoder25-Oct-10 13:19
Yet Another XCoder25-Oct-10 13:19 
GeneralReason for my vote of 5 Works as promised Pin
GodOnlyKnows25-Oct-10 11:09
GodOnlyKnows25-Oct-10 11:09 
GeneralReason for my vote of 5 Worked great Pin
bjreed22-Oct-10 7:51
bjreed22-Oct-10 7:51 
GeneralReason for my vote of 5 Good Job Pin
barsham19-Oct-10 16:53
barsham19-Oct-10 16:53 
GeneralReason for my vote of 1 Give Like this Tips Pin
karthikvadugan19-Oct-10 2:34
karthikvadugan19-Oct-10 2:34 
GeneralReason for my vote of 5 A very useful regular expression tha... Pin
dannielley2k118-Oct-10 21:56
dannielley2k118-Oct-10 21:56 
GeneralReason for my vote of 5 To be clear: do not type the quotes ... Pin
Emile van Gerwen18-Oct-10 21:31
Emile van Gerwen18-Oct-10 21:31 
GeneralReason for my vote of 5 Basic but powerfull Pin
SohelElite18-Oct-10 20:44
SohelElite18-Oct-10 20:44 
GeneralReason for my vote of 1 Poor Pin
Romano Scuri18-Oct-10 20:41
Romano Scuri18-Oct-10 20:41 
GeneralReason for my vote of 5 Really Useful one Pin
thatraja16-Oct-10 21:32
professionalthatraja16-Oct-10 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.