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