#string 操作要点
a=‘thankyou‘
print a.capitalize()
print a.center(20)
print a.endswith(‘s‘)
print a.startswith(‘t‘)
print a.find(‘o‘)
print a.center(20,‘\‘‘)
print a.rjust(20,‘+‘)
‘oo‘.join(a)
print a
print a.split(‘k‘)
print a.strip()
print a.strip(‘yu‘)
print a.replace(‘o‘,‘ww‘)
ans:
Thankyou
thankyou
False
True
6
‘‘‘‘‘‘thankyou‘‘‘‘‘‘
++++++++++++thankyou
thankyou
[‘than‘, ‘you‘]
thankyou
thankyo
thankywwu