How do I convert string to array of byte?

  • Thread starter Thread starter aurora
  • Start date Start date
A

aurora

I something like this:

dim mybytes() as byte = "hello world"

The string is ascii.
 
Dim bytes As Byte()
Dim text As String = "hello world"
Dim b As Byte
bytes = System.Text.ASCIIEncoding.ASCII.GetBytes(text)

Hope it helps :)

Mythran
 

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