特别说明:以下所有的指定范围只能从0-255以内
1、count
#计算子字符串(字符串表示的二进制数据)在规定范围内出现的次数
bytes.count(sub[, start[, end]])
bytearray.count(sub[, start[, end]])
2、decode
#返回指定编码的字符串表示二进制数据
bytes.decode(encoding="utf-8", errors="strict")
bytearray.decode(encoding="utf-8", errors="strict")
3、endswith
#判断给定的(字符串表示二进制数)是否在指定范围内的结尾(是否是指定范围内的后缀)
bytes.endswith(suffix[,start[,end]])
bytearray.endswith(suffix[,start[,end]])
4、find
#判断子指定范围的字符串(字符串表示二进制数据)是否存在字符串(字符串表示二进制数据)中
bytes.find(sub[,start[,end]]
bytearray.find(sub[,start[,end]]
5、index
#查找子字符串(字符串表示的二进制数据)在指定范围内的索引位置
bytes.index(sub[,start[,end]])
bytearray.index(sub[,start[,end]])
6、join
#以字节数组为分隔符,来显示迭代器中的内容
bytes.join(iterable)
batearray.join(iterable)
7、maketrans
#是一个静态方法
#将(to)指定的二进制数据字符,映射到表中相同位置,相同长度的(from)位置上
static bytes.maketrans(from, to)
static bytearray.maketrans(from, to)