DEV Community

Cover image for Remove Space/Empty New Line on VSCode with Regex
0xkoji
0xkoji

Posted on

7

Remove Space/Empty New Line on VSCode with Regex

Photo by Joan Gamell on Unsplash

Remove space

  1. Cmd+F / Ctrl + F
  2. type \n in Find input
  3. leave Replace blank
  4. click replace one by one / replace all

Remove empty new line

  1. Cmd+F / Ctrl + F
  2. type ^\n in Find input
  3. leave Replace blank
  4. click replace one by one / replace all

Top comments (2)

Collapse
 
elciodalosto profile image
Elcio Augusto Dalosto

Thanks! Saved me a lot of time learning this!

Collapse
 
shaijut profile image
Shaiju T • Edited

Nice, How to do same thing to replace spaces with underscores ?

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay