Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Created November 29, 2018 01:28
Show Gist options
  • Select an option

  • Save YumaInaura/fff5edeba3de2de71783a2434042c9c9 to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/fff5edeba3de2de71783a2434042c9c9 to your computer and use it in GitHub Desktop.
Ruby – 半角スペースも全角スペースも一緒に削除する例 ref: https://qiita.com/YumaInaura/items/2422332656a3411e6168
gsub(/[[:space:]]/, '')
[2] pry(main)> ' ←半角 ←全角'.gsub(/[[:space:]]/, '')
=> "←半角←全角"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment