Level 59 Level 61
Level 60

[No Typing] String Methods


37 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
string.center(width, fillchar)
returns centered in a string of length width. Padding is done using the specified fillchar
string.count(sub, start, end)
counts the number of occurrences of a substring in a string
string.decode(encoding, errors)
decodes the string using the codec registered for encoding
string.encode(encoding, errors)
returns an encoded version of the string
string.endswith(suffix)
returns True if the string ends with the specified suffix
string.expandtabs(size)
returns a string in which tab characters ie. '\t' are expanded using spaces
string.find(sub, start, end)
determines if a string occurs in string # returns the index if found and -1 otherwise
string.index(sub, start, end)
determines if string str occurs in string # returns the index if found and an exception otherwise
string.isalnum()
checks whether the string consists of alphanumeric characters
string.isalpha()
checks whether the string consists of alphabetic characters only
string.isdigit()
checks whether the string consists of digits only
string.islower()
checks whether all characters (letters) of the string are lowercase.
string.isnumeric()
checks whether the string consists of only numeric characters
string.isspace()
checks whether the string only consists of whitespace
string.istitle()
checks whether all the case-based characters in the string following non-casebased letters are uppercase and all other case-based characters are lowercase
string.isupper()
checks whether all the case-based characters (letters) of the string are uppercase
separator.join(sequence)
returns a string in which the string elements of sequence have been joined by a separator
len(string)
returns the length of the string
string.ljust(width, fillchar)
returns the string left justified in a string of length width
string.lower()
returns a string in which all case-based characters have been lowercased
string.lstring(chars)
returns a string in which chars have been stripped from the beginning of the string (default whitespace characters)
max(string)
returns the max alphabetical character from a string
min(string)
returns the min alphabetical character from a string
string.replace(old, new, count)
returns a string in which the occurrences of old have been replaced with new
string.rfind(sub, start, end)
returns the last index where the substring str is found, otherwise -1
string.rindex(sub, start, end)
returns the last index where a substring is found, otherwise raises an exception
string.rjust(width, fillchar)
returns the string right justified in a string of length width
string.rstrip(chars)
returns a string in which chars have been stripped from the end of the string (default whitespace characters)
string.split(separator, count)
returns a list of all the words in the string, using a separator
string.splitlines()
returns a list with all the lines in string
string.startswith(substring)
checks whether string starts with substring
string.strip(chars)
returns a string in which all chars have been stripped from the beginning and the end of the string
string.swapcase()
returns a string in which all the case-based characters have had their case swapped
string.title()
returns a string in which first characters of all the words are capitalized
string.upper()
returns a string in which all case-based characters have been uppercased
string.zfill(width)
pads string on the left with zeros to fill width
string.isdecimal()
checks whether the string consists of only decimal characters