Skip to content

Instantly share code, notes, and snippets.

@abdulhadad
Created May 22, 2023 06:09
Show Gist options
  • Save abdulhadad/823fde9a9edc6e7e932c62757c1d1888 to your computer and use it in GitHub Desktop.
Save abdulhadad/823fde9a9edc6e7e932c62757c1d1888 to your computer and use it in GitHub Desktop.
JS string trim and compact
" Text with spaces ".replace(/ +/g, ' ').trim()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment