Convert String or char[] to byte[]

  • Thread starter Thread starter Marius Cabas
  • Start date Start date
Check out UnicodeEncoding.GetBytes(). It has many overloads too.

How can I convert a String or a char[] to byte[]?
 
Use the ToCharArray method of a string to convert to a character array.

Use the GetBytes method of one of the Encoding classes to convert a string
to a byte array.
 
Back
Top