Range containability check : Range include « Range « Ruby






Range containability check




puts   (1..10)    === 5
puts   (1..10)    === 15
puts (1..10)    === 3.14159
puts   ('a'..'j') === 'c'
puts   ('a'..'j') === 'z'
 








Related examples in the same category

1.Test if something is included in the set of objects specified by the range.
2.Being a lowercase letter
3.is an integer in a range
4.is an integer in an exclusive range
5.Check the range belongings
6.Range pattern match