1.split (str = "", num )
to intercept a delimiter string str, and stores the result in a list. Specified num, num taken only string
2.splitlines ([keepends])
in accordance with ( '\ r', '\ r \ n', '\ n') separated, keepends = True retained when the line breaks
3.join (seq)
specified string delimiter, all the elements are combined into a seq string
4.max ()
to find the maximum value in the string, by comparing ASCII
5.min ()
to find the minimal string the value
returned is a space
6.replace (oldstr, newstr, count)
replaced oldstr with newstr, the default is replace all. If the count of the specified number, only the first alternative to count
7.startswith (str, start = 0, end = len (str1))
is determined in a given range if at the beginning of a given string, if not specified range default entire string
8.endswith (str, start, end = len (str1))
is determined in a given range if at the end of the given string, if not specified range, the entire string default
9.encode (encoding = "utf-8", errors = "strict") # encode
decode () # decoding
Note: the same encoding format encodes
10.isalpha ()
If there is at least one character string, and all characters are letters, returns True, otherwise return False
11.isalnum ()
if there is at least one character string, and all characters are letters or numbers, then returns True, otherwise return False
12.isupper ()
if there is at least an English character string, and all the characters are in uppercase letters, it returns True, otherwise return False
13.islower ()
has at least one if the string English characters, and all characters are lowercase letters, returns True, otherwise it returns False
14.istitle ()
If the string is the title (string first letter of each word is capitalized) of True is returned, False otherwise
15.isdigit ()
If the string contains only numeric characters return True, False otherwise
16.isspace ()
If the string contains only spaces, returns True, otherwise False
python learning Notes (String related operations supplement)
Guess you like
Origin blog.csdn.net/weixin_38324954/article/details/94597908
Recommended
Ranking