Answers for "c# byte array to structure"

C#
2

c# store byte array as string

public static void Main()
    {
        byte[] bytes = Encoding.Default.GetBytes("ABC123");
        Console.WriteLine("Byte Array is: " + String.Join(" ", bytes));
 
        string str = Encoding.Default.GetString(bytes);
        Console.WriteLine("The String is: " + str);
    }
Posted by: Guest on January-12-2021
0

c# store byte array as string

string utfString = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
Posted by: Guest on January-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language