扫码关注官方订阅号
小伙看你根骨奇佳,潜力无限,来学PHP伐。
当你要遍历 str 的每一个 byte 的时候就可以用 bytearray。特别是 python 3 里面 str,因为始终用 unicode 表示,只有用 bytearray 才能访问到字符串真正的 byte。
str
bytearray
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
当你要遍历
str的每一个 byte 的时候就可以用bytearray。特别是 python 3 里面str,因为始终用 unicode 表示,只有用bytearray才能访问到字符串真正的 byte。