Reversal of a Array can be done using reverse() method. It is independent of the alphabets. And is not a sort. It is just a reversal.
x = ["Mohan", "Kriti", "Salim"] y = x.reverse() puts "The Array in reversed order is #{y}"
So, in the above code we have created a Array and initialised to the variable x.
x = ["Mohan", "Kriti", "Salim"]
Below is how the values are positioned in the Array,
Then we have used the reverse() Method to reverse the elements of the Array x.
y = x.reverse()
And the new Array y has the items in reversed order with Salim as the first value, Mohan second and Kriti as the third.
And we get the below output.
The Array in reversed order is ['Salim', 'Kriti', 'Mohan']