Ruby - Basics and Runtime
The following Ruby code prints nothing. What is the problem?
text = "HELLO" puts text.upcase!
text = "HELLO" puts text.upcase!
upcase! behaviorupcase! method modifies the string in place and returns nil if no changes were made.upcase! makes no changes and returns nil, so puts prints nothing.nil is printed when no mutation occurs.upcase! returns nil if no changes made -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions