Ruby - Methods
What will be the output of this Ruby code?
str = "hello" result = str.upcase! puts result puts str
str = "hello" result = str.upcase! puts result puts str
upcase! effectupcase! method changes the string to uppercase in place and returns the modified string.result and strresult and str will be "HELLO" because the original string was changed.upcase! modifies and returns changed string [OK]upcase! returns nil alwaysupcase and upcase!15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions