String Methods Flashcards
(42 cards)
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.
str.islower()
Returns true if all characters are lower case.
str.isnumeric()
Returns true if all characters are numeric.
str.isprintable()
Returns true if all characters are printable.
str.isspace()
Returns true if all characters are white space.
str.istitle()
Returns true if the string follows the rules of a title.
str.isupper()
Returns true if all characters are upper case.
str.join()
Joins the elements of an iterablevto the end of the string.
str.ljust
Returns a left justified version of the string.