源代码:
#!/usr/bin/ruby $, =", " # Array 值分隔符 range1 = (1..10).to_a range2 = ('bar'..'bat').to_a puts "#{range1}" puts "#{range2}"
运行结果:
#!/usr/bin/ruby $, =", " # Array 值分隔符 range1 = (1..10).to_a range2 = ('bar'..'bat').to_a puts "#{range1}" puts "#{range2}"