原创 如何去掉字符串中不需要的字符

# 方法一s = '  abc  123             'print s.strip()  # 去掉兩端的空格print s.lstrip()  # 去掉左端的空格print s.rstrip()  # 去掉右端的空格s = '-