See str.swapcase.