Method | Description |
---|
len() | used to determine the length of the string. |
isalnum() | used to define the string is alphanumeric. |
islower() | To define a string is in small letters. |
isupper() | To define a string is in capital letters. |
isnumeric() | The string consists of only numbers. |
istitle() | The string is in the title case. |
isspace() | The string has only white space. |
find() | Searches the string value and returns the position. |
format() | Formats specified values in a string |
format_map() | Formats specified values in a string |
index() | returns the position of string where it was found |
count() | Returns the number of times string occurs. |
stratswith() | the string starts with the given prefix. |
isdecimal() | all characters in the string are decimals |
isdigit() | all characters in the string are digits |
isidentifier() | Returns True if the string is an identifier |
endswith() | all characters in the string end with the given suffix. |
encode() | it encodes the string. |
isprintable() | all characters in the string are printable. |
capitalize() | it returns all the capital strings. |
center() | Returns the center string. |
_contain_() | the string we check is contained in another string or not. |
join() | Joins the elements of the string. |
ljust() | Returns a left-justified version of the string |
hash() | Returns the hash value of the given object. |
lstrip() | Returns a left trim version of the string |
maketrans() | Returns a translation table to be used in translations |
partition() | Returns a tuple where the string is parted into three parts |
replace() | string where a value is replaced with another value. |
rfind() | Search the string and returns the last position. |
rindex() | Search the string and returns the last position. |
rjust() | Returns a right-justified version of the string |
rpartition() | Returns a tuple where the string is parted into three parts |
rsplit() | Splits the string at the specified separator, and returns a list |
rstrip() | Returns a right trim of the string |
split() | Splits the string at the specified separator, and returns a list |
splitlines() | Splits the string at line breaks and returns a list |
id() | Returns the identity of the string. |
strip() | It trims the space between the strings. |
swap case() | In this, the lower case becomes the upper case and vice versa |
title() | Converts the first character of each word to upper case |
translate() | Returns a translated string |
upper() | Converts a string into the upper case. |
zfill() | Fills string with a specified number of 0's at the beginning. |