Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Created May 26, 2015 03:24
Show Gist options
  • Save tfentonz/3bb97fc2f39ea1e72a3a to your computer and use it in GitHub Desktop.
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
"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