python 字符串


python 字符串小节:

python3.3版本中maketrans()方法已被抛弃,转换成了内建函数bytearray.maketrans()、bytes.maketrans()、str.maketrans()。

translate()与replace()的区别是前者替换时是一一对应,长度一样,后者没有长度限制。

可参考官方文件https://docs.python.org/3.3/search.html?q=maketrans

 

python 字符串
 
 

你可能感兴趣的:(python)