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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top