曹佳润

Jerry Cao

Welcome to my homepage. The English version is coming very soon. Please stay tuned.


Python String manipulation

Python的字符串处理操作

s = 'hello,world! '

去空格和特殊符号

s.strip() 

查找字符

s.index()

比较字符串

cmp(str1,str2) #return -1,0,1

大小写

s.upper()
s.lower()

翻转字符串

str = s[::-1]

查找字符串

s.find()

分割字符串

s.split() #return a list 

Donation

取消

Thanks for your kindly support!

扫码支持
扫码支持
Please scan the QR code

The donation will be used to maintain this website