DEV Community

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

Posted on

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 ?