Answers for "string to bytearray"

18

c# string to byte array

string author = "Mahesh Chand";  
// Convert a C# string to a byte array  
byte[] bytes = Encoding.ASCII.GetBytes(author);  

// Convert a byte array to a C# string. 
string str = Encoding.ASCII.GetString(bytes);
Posted by: Guest on April-17-2020
6

c# string to byte array

// Convert a string to a C# byte[]
//change encoding depending on your data
string someText = "some data as text.";
byte[] bytes = Encoding.ASCII.GetBytes(author);

// Convert a byte array to a C# string    
string str = Encoding.ASCII.GetString(bytes);  
Console.WriteLine(str);
Posted by: Guest on April-09-2020
1

java string from byte array

String s = new String(bytes, StandardCharsets.UTF_8);
Posted by: Guest on June-10-2021
1

python convert string to byte array

a_string = "abc"
encoded_string = a_string. encode()
byte_array = bytearray(encoded_string)
print(byte_array)
Posted by: Guest on April-19-2021

Code answers related to "string to bytearray"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language