How to remove empty lines in text In Visual Studio?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ashish SrivastavaRank #2,169 · 655 reputationPosted Apr 3, 2016, 1:47 AM EDT
Click Ctrl-H (quick replace)
Tick "Use Regular Expressions"
In Find specify
^$\nIn Replace box delete everything.
Click "Replace All"
All empty lines will be deleted.
Regular expression for empty line consist of
Beginning of line
^End of line
$Line break
\n