Capitalize ()
|
Change the first character of a string to uppercase
|
Casefold ()
|
Change all characters of the entire string to lowercase
|
Center (width)
|
Centers the string and fills the new string with a space of length width
|
Count (Sub[,start[,end]])
|
Returns the number of occurrences of a sub within a string, with the start and end parameters representing the range, optional.
|
Encode (encoding= ' utf-8 ', errors= ' strict ')
|
Encodes a string in the encoding format specified by encoding.
|
EndsWith (Sub[,start[,end])
|
Checks whether the string ends with a sub substring, or returns False if True. The start and end parameters represent ranges and are optional.
|
Expandtabs ([tabsize=8])
|
Converts the tab symbol (\ t) in a string to a space, such as not specifying a parameter, and the default number of spaces is tabsize=8.
|
Find (Sub[,start[,end])
|
Detects if the sub is contained in a string, returns the index value if any, otherwise returns the -1,start and end parameters to indicate the range, optional.
|
Index (Sub[,start[,end]])
|
Same as the Find method, but an exception occurs if the sub is not in a string.
|
Isalnum ()
|
Returns True if the string has at least one character and all characters are letters or numbers, otherwise false is returned.
|
Isalpha ()
|
Returns True if the string has at least one character and all characters are letters, otherwise false is returned.
|
Isdecimal ()
|
Returns True if the string contains only decimal digits, otherwise false.
|
IsDigit ()
|
Returns True if the string contains only a number, otherwise false.
|
Islower ()
|
Returns True if the string contains at least one case-sensitive character, and the characters are lowercase, otherwise false.
|
IsNumeric ()
|
Returns True if the string contains only numeric characters, otherwise false is returned.
|
Isspace ()
|
Returns True if the string contains only spaces, otherwise false is returned.
|
Istitle ()
|
Returns True if the string is a caption (all words start with uppercase and the remaining letters are lowercase), otherwise false is returned.
|
Isupper ()
|
Returns True if the string contains at least one case-sensitive character, and the characters are uppercase, otherwise false.
|
Join (sub)
|
Inserts a string as a delimiter between all the characters in a sub.
|
Ljust (width)
|
Returns a left-aligned string and fills the new string with a width of length with a space.
|
Lower ()
|
Converts all uppercase characters in a string to lowercase.
|
Lstrip ()
|
Remove all spaces to the left of the string
|
Partition (sub)
|
Locate the substring sub, divide the string into a 3-tuple (pre_sub,sub,fol_sub), and return if the string does not contain a sub (' Original string ', ' ', ')
|
Replace (Old,new[,count])
|
Replaces the old substring in the string with the new substring and, if count specifies, does not exceed count times.
|
RFind (Sub[,start[,end])
|
Similar to the Find () method, it is just looking from the right.
|
Rindex (Sub[,start[,end])
|
Similar to the index () method, but starting from the right.
|
Rjust (width)
|
Returns a right-aligned string and fills the new string with a width of length with a space.
|
Rpartition (sub)
|
Similar to the partition () method, it is just looking from the right.
|
Rstrip ()
|
Removes a space at the end of a string. |