Created
May 26, 2015 03:24
-
-
Save tfentonz/3bb97fc2f39ea1e72a3a to your computer and use it in GitHub Desktop.
Convert string with comma separated integers with spaces to an array of integers
This file contains 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
"123, 45 6, 7 89".delete(' ').split(',').map(&:to_i) | |
# => [123, 456, 789] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment