运维网's Archiver
论坛
›
Python
› python 字符串
李斯特
发表于 2017-4-21 12:15:23
python 字符串
python 字符串小节:
python3.3版本中maketrans()方法已被抛弃,转换成了内建函数bytearray.maketrans()、bytes.maketrans()、str.maketrans()。
translate()与replace()的区别是前者替换时是一一对应,长度一样,后者没有长度限制。
可参考官方文件https://docs.python.org/3.3/search.html?q=maketrans
页:
[1]
查看完整版本:
python 字符串