1. Case conversion
Judging a string
<textarea class="crayon-plain print-no" style="font-size: 12px !important; line-height: 15px !important; z-index: 0; opacity: 0; overflow: hidden" readonly="" data-settings="dblclick">s.isalnum () #所有字符都是数字或者字母 s.isalpha () #所有字符都是字母 s.isdigit () #所有字符都是数字 s.islower () #所有字符都是小写 s.isupper () #所有字符都是大写 S. Istitle () #所有单词都是首字母大写, like the title S.isspace () #所有字符都是空白字符, \ t, \ n</textarea>
| 1234567 |
s. Isalnum() #所有字符都是数字或者字母 s. Isalpha() #所有字符都是字母 s. IsDigit() #所有字符都是数字 s. Islower() #所有字符都是小写 s. Isupper() #所有字符都是大写 s. Istitle() #所有单词都是首字母大写, like the title s. Isspace() #所有字符都是空白字符, \ t, \ n |
Uppercase and lowercase conversions
<textarea class="crayon-plain print-no" style="font-size: 12px !important; line-height: 15px !important; z-index: 0; opacity: 0; overflow: hidden" readonly="" data-settings="dblclick">s.upper () #把所有字符中的小写字母转换成大写字母s. Lower () #把所有字符中的大写字母转换成小写字母s. Capitalize () #把第一个字母转化为大写字母, remaining lowercase s.title () # Convert the first letter of each word to uppercase, the remaining lowercase</textarea>
| 1234 |
s. Upper() #把所有字符中的小写字母转换成大写字母 s. Lower() #把所有字符中的大写字母转换成小写字母 s. Capitalize() #把第一个字母转化为大写字母, remaining lowercase s. Title() #把每个单词的第一个字母转化为大写, remaining lowercase |
Python string manipulation