In : determine if a character is in a string
Not ni: determine if something is in something
Base: convert to Binary
bit_length : Binary of the current number, at least in several representations
capitalize: Initial Capitalization if there are other uppercase characters in the string, it becomes lowercase
Casefold: Turn all the lowercase
Lower: just turn English into lowercase
Center: Set the width and center the character
Center (Width,fillchar)
Count: indicates the number of characters that appear
count ("_", Start,end)
EndsWith: endswith (self,suffix,start,end) indicates the judgment or not of what to start or end with.
StartsWith: Starswith (self,suffix,start,end) indicates the judgment or not of what to start or end with.
Find: Find (self,sub,star,end) from the beginning, and perhaps its location
format : Format (*args,**kargs) to replace placeholders in a string with the specified values
For example:
test='I love {you}'print(test) v=test.format (you="She ")print(v)
Format_map: formatted, passed in value {"abc": "Def", "a": "A")
isalnum: determines that the string contains only alphanumeric
isalpha: Determine if the string is a letter
Isdecimal: Judging whether a string is a number (judging ② is not a number)
isdigit: determine if the string is a number (you can tell ② is a number)
isnumeric: Determine if the string is a number (both the two and 2 types of ② and Chinese are judged to be numbers)
islower: determine if lowercase
Lower: Convert to lowercase
isupper: Judging capitalization
Upper: converting to uppercase
isprintable: does not print if an invisible, such as newline character \ n, is present in the print
Isspace: Determines whether the string is a space, if not all the space is wrong
istitle: determine if the first letter in the title is uppercase
Title : Convert the first letter in the title to uppercase
join: Separate the strings
For example:
A=" iloveyou"b="_"= B.join (a) Print (v) _i_l_o_v_e_y_o_u
rjust: rjust (Self,width,fillchar) fill in the front of a string
Lstrip:rstrip:strip: Remove the space on the left or right side of the character or blank line or specify the character in the brackets below to remove it
Maketrans: Substitution of correspondence relation
Partition: Divide the string into three parts
swapcase: Conversion of size
Data base types and commands for Python