Case manipulation

suggest change
"string".upcase     # => "STRING"
"STRING".downcase   # => "string"
"String".swapcase   # => "sTRING"
"string".capitalize # => "String"

These four methods do not modify the original receiver. For example,

str = "Hello"
str.upcase # => "HELLO"
puts str   # => "Hello"

There are four similar methods that perform the same actions but modify original receiver.

"string".upcase!     # => "STRING"
"STRING".downcase!   # => "string"
"String".swapcase!   # => "sTRING"
"string".capitalize! # => "String"

For example,

str = "Hello"
str.upcase!  # => "HELLO"
puts str     # => "HELLO"

Notes:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents