运维网's Archiver
论坛
›
Python
› python 去掉空格函数
爱死你了
发表于 2017-5-1 07:04:08
python 去掉空格函数
str.strip() 同时去掉左右两边的空格
str.lstrip() 去掉左边的空格
str.rstrip() 去掉右边的空格
eg:
m = ' jafefefe '
minfo = m.strip()
print minfo
输出结果:jafefefe
页:
[1]
查看完整版本:
python 去掉空格函数