Created
April 24, 2020 07:47
-
-
Save ooca-big/df09b346744d17fd7f3aa9dc19c084be to your computer and use it in GitHub Desktop.
replace multiple spaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let input = ` a adf asdfasdfa sasdf asf asdf adsf a asdfa sasdfasdf | |
| asdf sa sfd | |
| sadfi asdf asdfa asdf adf asdfasdf asdf asdf813rkj ฟวห่กดาสฟ ืหกด ฟกด | |
| หกดฟฟหก ฟหด ่ฟ | |
| ฟห covid--19` | |
| console.log(input.replace(/[\-_\.\*\+\/\#\$\@\ \t]{2,}/g, '').replace(/\n{2,}/g, '\n')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment