Case Conversion Methods



This category of built-in methods of Python's str class deal with the conversion of alphabet characters in the string object. Following methods fall in this category −

Sr.No. Method & Description

1

capitalize()

Capitalizes first letter of string

2

casefold()

Converts all uppercase letters in string to lowercase. Similar to lower(), but works on UNICODE characters alos

3

lower()

Converts all uppercase letters in string to lowercase.

4

swapcase()

Inverts case for all letters in string.

5

title()

Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.

6

upper()

Converts lowercase letters in string to uppercase.

python_string_methods.htm
Advertisements