1、strip() 方法
Python strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。
2、Python encode() 方法
以 encoding 指定的编码格式编码字符串。errors参数可以指定不同的错误处理方案。语法:str.encode(encoding=‘UTF-8‘,errors=‘strict‘)
3、Python decode() 方法
以 encoding 指定的编码格式解码字符串。默认编码为字符串编码。decode()方法语法:str.decode(encoding=‘UTF-8‘,errors=‘strict‘)
python中strip()、encode()、decode()函数
原文:https://www.cnblogs.com/shiheyuanfang/p/13214285.html