标签:pre col 字符 color -- strip 函数 bsp 入参
#去除空 >>> s = ‘ 0000a0bc0000‘ >>> s.strip() ‘0000a0bc0000‘ #去除首尾字符‘0‘ >>> s = ‘0000a0bc0000‘ >>> s.strip(‘0‘) ‘a0bc‘
不传入参数默认去除首尾空格
strip()函数只能去除首尾字符,中间的字符并不能去除
标签:pre col 字符 color -- strip 函数 bsp 入参
原文地址:https://www.cnblogs.com/thebear/p/9260676.html