1.

The .upcase and .capitalize method are used for capitalizing the whole string.(a) True(b) FalseI had been asked this question in an interview for job.My doubt is from Formatting String Methods topic in chapter Ruby Basics of Ruby

Answer» RIGHT CHOICE is (b) False

To elaborate: The .capitalize method doesn’t change the whole string to uppercase, it just CAPITALIZES the FIRST letter.


Discussion

No Comment Found

Related InterviewSolutions