print(‘000123123‘.find(‘1‘)) print(‘000123123‘.rfind(‘1‘)) print(‘***000123123***‘.lstrip(‘*‘)) print(‘***000123123***‘.rstrip(‘*‘)) print(‘华丽分割线‘.center(50,‘=‘)) print(‘华丽分割线‘.ljust(50,‘=‘)) print(‘华丽分割线‘.rjust(50,‘=‘)) print(‘123‘.zfill(10)) print(‘%010d‘ % 123) print(‘000\t123‘.expandtabs(30)) print(‘AbC‘.swapcase()) print(‘四‘.isdigit()) print(‘四‘.isdecimal()) print(‘四‘.isnumeric()) # True print(‘肆‘.isnumeric()) # True print(‘Ⅳ‘.isnumeric()) # True print(‘a_1‘.isidentifier()) print(‘ABCc‘.isupper()) print(‘ABCc‘.islower()) print(‘Aooc Abc Aaa‘.istitle()) print(‘ \n\r\t‘.isspace())
PythonStudy——字符串扩展方法 String extension method
原文:https://www.cnblogs.com/tingguoguoyo/p/10726616.html