Answers for "how can you convert an array of bytes to string?"

-1

convert byte array to string

byte[] byteArray1 = { 80, 65, 78, 75, 65, 74 };
String str = new String(byteArray1, 0, 3, StandardCharsets.UTF_8);
Posted by: Guest on August-06-2020
1

how to convert a byte array to string in python

b = bytearray("test", encoding="utf-8")
# here test is encoded into a byte array 
str1 = bytes(b)
# the function bytes decodes it for us !!! 
print(str1)
#thank god for python
Posted by: Guest on November-23-2021

Code answers related to "how can you convert an array of bytes to string?"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language