Range operators in Ruby

16-Aug-2016 3900

Range operators in ruby are used to extract a sequence. Sequences have an initial point and end point by which we can generate consecutive values in the sequence. The values of a range may be objects, numbers, characters or strings.

 

There are two types of range operators:

1Inclusive range operator that is two-dot (..)
2. Exclusive operator that is three-dot operator (...)

Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle