String and String Methods


#1

In 15/16 exercise I wrote following code
name = "Rohitha"
name.downcase
name.reverse
name.upcase
and I am getting the output as "ROHITHA" and if i chain those methods and write the code as name = "Rohitha"
name.downcase.reverse.upcase
I am getting the output as "AHTIHOR".I can't understand why is it coming so?


#2

You have reverse and upcase on


#3

Thank you for your reply.After seeing your reply I am able to understand.In name.downcase.reverse,upcase for the reversed one it is getting upcase.