Skip to content

Instantly share code, notes, and snippets.

@TimLang
Last active December 31, 2015 17:09
Show Gist options
  • Save TimLang/8018573 to your computer and use it in GitHub Desktop.
Save TimLang/8018573 to your computer and use it in GitHub Desktop.
removing the space which is NBSP; replacing all whitespaces, including the non-ASCII ones
#removing the space which is NBSP
" B.我国人民民主具有广泛性"..gsub(/[[:space:]]/, '')
#or
NBSP = "\u00a0"
str.gsub(NBSP, '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment