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 ?

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay