Mega Code Archive

 
Categories / Ruby / Range
 

To create a range, use the operator For example, heres how you might create the range 1 to 4

my_range = 1..4 puts my_range