#Python中strip()

18.(str).strip()
截掉(删掉)截掉字符传中左右两端的指定字符,默认状态下为空格

str9 = "*****AAAAAAAA ****"
print(str9.strip("*"))
#(输出)AAAAAAAA 

猜你喜欢

转载自blog.csdn.net/weixin_43097301/article/details/82946618