Created
August 11, 2012 09:52
-
-
Save omkz/3323254 to your computer and use it in GitHub Desktop.
ruby ranges to_a
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
#!/usr/bin/ruby | |
$, =", " # Array value separator | |
range1 = (1..10).to_a | |
range2 = ('bar'..'bat').to_a | |
puts "#{range1}" | |
puts "#{range2}" | |
#to_a digunakan untuk convert range ke list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment