Strip方法 发表于 2020-02-17 阅读次数: 12345678910# strip方法用于移除字符串头尾的字符(默认为空格或者换行符)或字符序列strs = "happp "print(strs.strip())print(strs.strip().strip('p'))"""输出结果:happpha""" 本文作者: nianchu 本文链接: http://www.nianchu.space/2020/02/17/Python/Strip方法/ 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!