Created
April 4, 2013 12:05
-
-
Save ifukazoo/5309835 to your computer and use it in GitHub Desktop.
RangeからArrayを作る
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
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