method

swapcase

v1_8_7_330 - Show latest stable - Class: String
swapcase()
public

Returns a copy of str with uppercase alphabetic characters converted to lowercase and lowercase characters converted to uppercase.

"Hello".swapcase          #=> "hELLO"
"cYbEr_PuNk11".swapcase   #=> "CyBeR_pUnK11"