Contents

Roo

Text.swapcase!

Returns a new Text object where the case of each character is swapped. The case of each character of the original text is also swapped.

var a = "Dr Garry Pettet"
var b = a.swapcase!
print(a) # => "dR gARRY pETTET"
print(b) # => "dR gARRY pETTET"