Skip to content

Instantly share code, notes, and snippets.

@aderaaij
Last active December 1, 2017 20:22
Show Gist options
  • Save aderaaij/733defff5c9aa24f0e8209b70fd7c983 to your computer and use it in GitHub Desktop.
Save aderaaij/733defff5c9aa24f0e8209b70fd7c983 to your computer and use it in GitHub Desktop.
const text = text.replace(/\s(?=[^\s]*$)/g, ' ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment