python删除字符串两边的空格

import string
string = '  How are you  '
result = str.strip(string)
print(result)

代码环境 : py3.6

猜你喜欢

转载自blog.csdn.net/qq_40258748/article/details/87989653
今日推荐