首页 > 编程语言 > 详细

PythonStudy——字符串扩展方法 String extension method

时间:2019-04-17 22:44:55      阅读:273      评论:0      收藏:0      [点我收藏+]
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

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!