You are here : python_2stringstringswapcase

string.swapcase() - string

             

The method swapcase() returns a copy of the string in which all the case-based characters have had their case swapped.


  • NA


Syntax

str.swapcase();


Example

#!/usr/bin/python

str = "this is string example....wow!!!";
print str.swapcase()

str = "THIS IS STRING EXAMPLE....WOW!!!";
print str.swapcase()


Output / Return Value

When we run above program, it produces following result −


THIS IS STRING EXAMPLE....WOW!!! this is string example....wow!!!


Limitations


Alternatives / See Also


Reference