String Methods Flashcards
str.capitalize()
Return a copy of the string with its first character capitalized and the rest lowercase.
str.casefold()
Return a case folded copy of the string.
str.center()
Return a centered string
str.count()
Returns the number of times a value occurs in a string.
str.encode()
Returns an encoded version of the string.
str.endswith()
Returns true if the string ends with specified value.
str.expandtabs()
Sets the tab size of the string
str.find()
Searches a string for a value and returns the position where it was found.
str.format()
Formats specified values in a string.
str.format_map()
Formats specified values in a string.
str.index()
Searches a string for a specified value and returns it’s position
str.isalnum()
Returns true if all characters are alpha numeric.
str.isalpha()
Returns true if all characters are letters.
str.isdecimal()
Returns true if all characters are decimals.
str.isdigit()
Returns true if all characters are digits.
str.isidentifier()
Returns true if string is an identifier.