name=" my name is? shi\tzhilong"
print(name.capitalize())
print(name.count("i"))
print(name.center(50,"-"))#居中打印
print(name.endswith("ng"))#判斷字符串以什么結(jié)尾
print(name.expandtabs(tabsize=20))#將換行符轉(zhuǎn)化成空格
print(name[name.find("i"):])
print(name.format(name='sfs',year=23))
name=" my name is? {name} and? age is {age}"
print(name.format(name='shizhilong',age='18'))# 標(biāo)準(zhǔn)化
print(name.format_map({'name':'shizhilong','age':12}))#字典標(biāo)準(zhǔn)化
print('ab123'.isalnum())#判斷字符是否包含阿拉伯?dāng)?shù)字
print('ab'.isalpha())#是否包含英文
print('1A'.isdecimal())
print('1A'.isdigit())#是不是整數(shù)
print('anss'.isidentifier())#是不是合法的變量名
print('2.5'.isnumeric())#是不是數(shù)字
print(' '.isspace())
print('My? Name? Is'.istitle())#是不是標(biāo)題
print('My? Name? Is'.join("http://"))#間隔粘貼
print('+'.join(['1','2','3']))#把列表轉(zhuǎn)化為字符串
print(name.ljust(50,'*'))#左填充
print(name.rjust(50,'#'))#右填充
print('shizhilong'.islower())
print('shizhilong'.isupper())
print('? ? sad\n'.lstrip())#左邊去掉空格
p=str.maketrans("ai",'12')#密碼替換
print(name.translate(p))
print(name.replace('i','I',2))#替換
print('zhilong'.rfind('g'))# 找到指定字符最右邊的位置
print('zhilong'.split("i"))#按照指定字符分割成列表
print('dada\nddads'.splitlines())#
print('alRDADs'.swapcase())#大寫變小寫嚷往,小寫變大些
print('alRDADs'.title()) ? #轉(zhuǎn)化為標(biāo)題
print('alRDADs'.zfill(50))#字符串的所有操作