Click here to Skip to main content
15,917,875 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
how to copy value from string array to byte array in vb.net10
Posted

1 solution

You did not provide a code sample, so I assumed that you meant a String data type to a Byte Array data type. If this is not what you wanted, please use "Improve Question" link above and provide some sample code.

I found the answer via Google.

How to: Convert Strings into an Array of Bytes in Visual[^]


VB
Private Function UnicodeStringToBytes(
    ByVal str As String) As Byte()

    Return System.Text.Encoding.Unicode.GetBytes(str)
End Function
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900