字符串类型
byte 字符串
byte_str = b”byte example”str 字符串
str_str = “str example”
str to bytes 字符串转字节
1 | bytes(str_str, encoding="utf-8") |
或1
str_str.encode()
bytes to str 字节转字符串
1 | str(byte_str, encoding="utf-8") |
或1
byte_str.decode()
byte 字符串
byte_str = b”byte example”
str 字符串
str_str = “str example”
1 | bytes(str_str, encoding="utf-8") |
或1
str_str.encode()
1 | str(byte_str, encoding="utf-8") |
或1
byte_str.decode()
支付宝