去除空格方法:
" xyz ".strip() # returns "xyz"
" xyz ".lstrip() # returns "xyz "
" xyz ".rstrip() # returns " xyz"
" x y z ".replace(‘ ‘, ‘‘) # returns "xyz"
本文出自 “Mr_Computer” 博客,请务必保留此出处http://caochun.blog.51cto.com/4497308/1550532
原文地址:http://caochun.blog.51cto.com/4497308/1550532