Created
December 10, 2015 07:57
-
-
Save YumaInaura/c06b59f6ef2b49aea173 to your computer and use it in GitHub Desktop.
Ruby | String には grep じゃなく match ref: http://qiita.com/Yinaura/items/0eb78d64f788fc4a35ce
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
| 'ABC'.grep /B/ | |
| # => NoMethodError: undefined method `grep' |
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
| 'ABC'.match /B/ | |
| # => #<MatchData "B"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment