Skip to content

Instantly share code, notes, and snippets.

@ifukazoo
Created April 4, 2013 12:05
Show Gist options
  • Save ifukazoo/5309835 to your computer and use it in GitHub Desktop.
Save ifukazoo/5309835 to your computer and use it in GitHub Desktop.
RangeからArrayを作る
irb(main):003:0> 10.times.map{|f| f.to_s}
=> ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
irb(main):004:0> 2.upto(10).map{|f| f.to_s}
=> ["2", "3", "4", "5", "6", "7", "8", "9", "10"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment