One
1. Upper ()
Function: Converts a character in a string to uppercase
in [+]: spamout['hello,world'in[print(Spam.upper ()) Hello,world
2.lower ()
Function: Converts a character in a string to lowercase
in [+]: spam = spam.upper () in []: spamout['hello,world'in[ Print (Spam.lower ()) Hello,world
3.isupper ()
Function: Determines whether there are uppercase characters in a string
in [+]: spamout['hello,world'in[]: spam.isupper () out[ all]: True
4.islower ()
Function: Determine if there are lowercase characters in the string
in [+]: spamout['hello,world'in[]: Spam.islower () out[25] : False
5.isalpha ()
Isalpha () returns True if the string contains only letters and is not empty
in [+]: spamout['hello,world'in[]: Spam.isalpha () out[ (): False
6.isalnum ()
Isalnum () returns True if the string contains only letters and numbers and is not empty
' 123hello ' In [Max]: Mystring01.isalnum () out[]: True
7.isdecimal ()
Isdecimal () returns True if the string contains only numeric characters and is not empty
' 123456 ' In [the]: Mystring01.isdecimal () out[]: True
8.isspace ()
Isspace () returns True if the string contains only spaces, tabs, and line breaks, and is not empty
"in[si]: mystring01.isspace () out[]: True
9.istitle ()
Istitle () returns True if the string contains only words with uppercase letters that are followed by lowercase letters
' Helloworld ' In [[]: Mystring01.istitle () out[]: True
10.startswith ()
The StartsWith () method returns True if the string they are calling starts with the string passed in by the method
' Hello World '. StartsWith ('hello') out[]: True
11.endswith ()
The EndsWith () method returns True if the string they are invoking ends with the string passed in by the method
' Hello World '. EndsWith ('ld') out[]: True
12.join ()
Splicing String list
' - '. Join (['aaa', 'bbb','CCC ' ]) out['aaa-bbb-ccc'
13.split ()
Explode string
' AAA-BBB-CCC '. Split ("-") out[]: ['aaa' BBB ' ' CCC ']
14.strip ()
(1) Delete blank characters on both sides
Print (mystring01) Hel Lo, w o r ldin [print(Mystring01.strip ()) Hel Lo, w o r ld
(2) Delete the specified string
Print (mystring01) Hel Lo, w o r ldin [print(Mystring01.strip (' hel lo' ) )), W o r ld
15.lstrip ()
Remove left white space character
Print (mystring01) Hel Lo, w o r ldin [print(Mystring01.lstrip ()) Hel Lo, w o r ld
16.rstrip ()
Delete Right white space character
Print (mystring01) Hel Lo, w o r ldin [print(Mystring01.rstrip ()) Hel Lo, w o r ld
17.pyperclip Module
Using the Pyperclip module's total copy and paste parameters
Import pyperclippyperclip.copy ('Hello world! ' ) Pyperclip.paste ()
Python string-method