Dim s As String = "Hello World"
MessageBox.Show("Base String: " & s)
Dim b() As Byte = System.Text.UTF8Encoding.UTF8.GetBytes(s)
MessageBox.Show("Converted from byte array to string: " & System.Text.UTF8Encoding.UTF8.GetString(b))
there is a neat way of converting to char array - dont know if this is what you want
Dim test1() As Char
Dim strwork As String = "123456"
test1 = strwork.ToCharArray
I gotcha. I don't think SByte stands for String Byte. But anyways, you can try something like the following:
Code:
Dim s As String = "Hello World"
Dim sbs() As SByte
Dim chars As Char() = s.ToCharArray
For i As Integer = 0 To chars.Length - 1
ReDim Preserve sbs(i)
sbs(i) = Convert.ToSByte(chars(i))
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.