This article mainly introduces how to use Python to determine string and case-sensitivity conversion. For more information, see.
Judge string
S. isalnum () # All characters are numbers or letters. isalpha () # All characters are letters s. isdigit () # All characters are numbers. islower () # All characters are lowercase s. isupper () # All characters are uppercase s. istitle () # All words are capitalized, like the title s. isspace () # All characters are blank characters, \ t, \ n
Case-sensitive conversion
S. upper () # converts lowercase letters in all characters into uppercase letters (s. lower () # Convert all uppercase letters into lowercase letters s. capitalize () # convert the first letter to an upper-case letter, and the other lower-case s. title () # convert the first letter of each word into uppercase letters, and the rest in lower case
The above is all the content of this article. I hope you will like it.