Methods |
Descriptions |
capitalize() |
This Python in-built function is for String which makes the first letter of the string in uppercase. |
center(width, fillchar) |
This Python in-built function for String returns a space-padded string with the original string centred to a total of width columns. |
count(str, beg= 0,end=len(string)) |
This Python in-built function for String counts how many times str occurs in the string or a substring of string if beginning index beg and ending index end are given. |
decode(encoding=‘UTF8’,errors=‘strict’) |
This Python in-built function for String decodes the string using the codec registered for encoding. Encoding defaults to the default string encoding. |
encode(encoding=‘UTF8’,errors=‘strict’) |
This Python in-built function for String replace encoded string version of string; on error, default is to raise a ValueError unless bugs are supported with ‘ignore’ or ‘replace’. |
endswith(suffix, beg=0, end=len(string)) |
This Python in-built function for String determines if a string or a substring of string (if beginning index beg and ending index end are given) ends with a suffix; returns true if so and false. |
expandtabs(tabsize=8) |
This Python in-built function for String expands tabs in the string to various spaces; defaults to 8 spaces per tab if tabsize not given. |
find(str, beg=0 end=len(string)) |
This Python in-built function for String determines if str occurs in the string or a substring of string if beginning index beg and ending index end are provided returns index if found and -1. |
index(str, beg=0, end=len(string)) |
This Python in-built function for String is the same as find() but raises an exception if str not found. |
isalnum() |
This Python in-built function for String returns true if the string has minimum one character and all characters are alphanumeric and false otherwise. |
isalpha() |
This Python in-built function for String returns true if the string has minimum one character and all characters are alphabetic and false otherwise. |
isdigit() |
This Python in-built function for String returns true if the string contains only digits and false. |
islower() |
This Python in-built function for String returns true if the string has at least one cased character and all cased features are in lowercase and false. |
isnumeric() |
This Python in-built function for String returns true if a Unicode string contains only numeric characters and false otherwise. |
isspace() |
This Python in-built function for String returns true if the string contains only whitespace characters and false otherwise. |
istitle() |
This Python in-built function for String returns true if the string is appropriately “titlecased” and false otherwise. |
isupper() |
This Python in-built function for String returns true if the string has minimum one cased character and all cased features are in uppercase and false. |
join(seq) |
This Python in-built function for String merges (concatenates) the string representations of elements in sequence seq into a string, with separator string. |
len(string) |
This Python in-built function for String returns the length of the string. |
ljust(width[, fillchar]) |
This Python in-built function for String returns a space-padded string with the original string left-justified to a total of width columns. |
lower() |
This Python in-built function for String converts all uppercase letters in a string to lowercase. |
lstrip() |
This Python in-built function for String removes all leading whitespace in string. |
maketrans() |
This Python in-built function for String returns a translation table to be used in translate function. |
max(str) |
This Python in-built function for String returns the max alphabetical character from the string str. |
min(str) |
This Python in-built function for String returns the min alphabetical character from the string str. |
replace(old, new [, max]) |
This Python in-built function for String would replace all occurrences of old in the string with new or at most max appearance if max gave. |
rfind(str, beg=0,end=len(string)) |
This Python in-built function for String is the same as find () but search backwards in the string. |
rindex( str, beg=0, end=len(string)) |
This Python in-built function for String is the same as an index () but search backwards in the string. |
rjust(width,[, fillchar]) |
This Python in-built function for String returns a space-padded string with the original string right-justified to a total of width columns. |
rstrip() |
This Python in-built function for String removes all trailing whitespace of string. |
split(str=””, num=string.count(str)) |
This Python in-built function for String splits string according to delimiter str (space if not provided) and returns a list of substrings; divided into at most num substrings if given. |
splitlines( num=string.count(‘\n’)) |
This Python in-built function for String splits a string at all (or num) NEWLINEs and restore a list of every line with NEWLINEs removed. |
strip([chars]) |
This Python in-built function for String performs both lstrip() and rstrip() on the string. |
swapcase() |
This Python in-built function for String inverts case for all letters in a string. |
translate(table, deletechars=””) |
This Python in-built function for String translates string according to translation table str(256 chars), removing those in the del string. |
upper() |
This Python in-built function for String converts lowercase letters in a string to uppercase. |
zfill (width) |
This Python in-built function for String returns initial string leftpadded with zeros to a total of width characters; intended for numbers, zfill () retains few sign provided (less one zero). |
isdecimal() |
This Python in-built function for String returns true if a Unicode string contains only decimal characters and false otherwise. |