Skip to content

Instantly share code, notes, and snippets.

@cjoshmartin
Last active May 23, 2017 20:28
Show Gist options
  • Save cjoshmartin/aa28ef2a62af099ddbde924179980219 to your computer and use it in GitHub Desktop.
Save cjoshmartin/aa28ef2a62af099ddbde924179980219 to your computer and use it in GitHub Desktop.
removing extra space in a string in JS
var text ="ECE 32700 ENGINEERING ECONOMICS";
text=text.replace(/ +(?= )/g,'');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment