Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' String to byte
- ' Native C# strings are unicode encoded
- Dim StringMessage As String = "Hello World How Are you? Pi π Yen ¥"
- ' We can show the characters on the command line
- Console.WriteLine("{0}", StringMessage)
- ' We can convert directly a byte array, but some information is lost
- Dim ASCII As New System.Text.ASCIIEncoding()
- Dim BytesMessage As [Byte]() = ASCII.GetBytes(StringMessage)
- ' Byte back to string
- Dim BytesMessage As [Byte]()
- ' Your message
- Dim ASCII As New System.Text.ASCIIEncoding()
- Dim StringMessage As [String] = ASCII.GetString(BytesMessage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement