About 46,400 results
Open links in new tab
  1. c# - How to convert byte array to string - Stack Overflow

    Nov 23, 2016 · This only works if your string was encoded with UTF16 which is c# string's default internal encoding scheme. If, say, the byte array was encoded simply with ASCII chars from …

  2. Converting string to byte array in C# - Stack Overflow

    Apr 18, 2013 · As of C# 11 (.Net 7) it is possible to just prefix a string literal with "u8" to convert it into a UTF-8 encoded byte[] or ReadOnlySpan<byte>. In case you need to use UTF-16 …

  3. c# - How can I safely convert a byte array into a string and back ...

    Mar 18, 2014 · The question here is - how do I convert from a byte array to a string and back, safely. I use the "magical" Latin1 encoding (Encoding.GetEncoding ( 28591 )) which seems to …

  4. c# - Converting byte array to string and printing out to console ...

    Converting byte array to string and printing out to console Asked 13 years, 5 months ago Modified 2 years, 9 months ago Viewed 197k times

  5. C# byte array to string, and vice-versa - Stack Overflow

    Aug 19, 2013 · I have some C++ code that persists byte values into files via STL strings &amp; text i/o, and am confused about how to do this in C#. first I convert byte arrays to strings …

  6. c# - How to convert UTF-8 byte [] to string - Stack Overflow

    A LINQ one-liner for converting a byte array byteArrFilename read from a file to a pure ASCII C-style zero-terminated string would be this: Handy for reading things like file index tables in old …

  7. c# - How to convert a byte [] to a string with {#, #, #} format ...

    The very handy string.Join is the key to what you want. public static string ByteArrayToString(byte[] byteArray) { return "{" + string.Join(", ", byteArray) + "}"; } If you're …

  8. How do you convert a string to a byte array in .NET?

    Oct 27, 2008 · I have a string that I need to convert to the equivalent array of bytes in .NET. This ought to be easy, but I am having a brain cramp.

  9. c# - An efficient way to Base64 encode a byte array? - Stack …

    I have a byte[] and I'm looking for the most efficient way to base64 encode it. The problem is that the built in .Net method Convert.FromBase64CharArray requires a char[] as an input, and …

  10. c# - Converting a string array to a byte array - Stack Overflow

    Jun 29, 2012 · Converting a string array to a byte array Asked 13 years, 4 months ago Modified 13 years, 4 months ago Viewed 28k times