← Back to Ruby Operators

Right Angle Bracket

The > (right angle bracket) symbol is used (by itself) in Ruby for a greater than comparison of two objects.

Greater Than Comparison

We can compare any two objects of the same type as long as they are Comparable.

> 10 > 9
=> true
> 9 > 10
=> false
> 'xyz' > 'abc'
=> true
> 'A' > 'z'
=> false
> 'a' > 'Z'
=> true

Numeric types, strings, dates, and times are all common examples of elements that get compared this way.

References