String Methods Flashcards
capitalize()
converts first character to capital letter
center()
pads string with specified character
casefold()
converts to casefolded strings
count()
returns occurences of substring in string
endswith()
checks if string end with the specified suffix
expandtabs()
replaces tab character with spaces
encode()
returns encoded string of given string
find()
returns highest index of substring
format()
formats string into nicer output
index()
returns index of substring
isalnum()
checks alphanumeric character
isalpha()
checks if all characters are alphabets
isdecimal()
checks decimal characters
isdigit()
checks digit characters
isidentifier()
checks for valid identifier
islower()
checks if all alphabets in a string are lowercase
isnumeric()
checks numeric characters
isprintable()
checks printable character
isspace()
checks whitespace characters
istitle()
checks for titlecased string
isupper()
returns if all characters are uppercase characters
join()
returns a concatenated string
ljust()
returns left-justified string of given width
rjust()
returns right-justified string of a given width
lower()
returns lowercased string
upper()
returns uppercased string
swapcase()
swap uppercase characters to lowercase; vice versa