|
|
Convert Byte[]( Byte Array) to String
Here 'b' is the byte array
C#
string strModified = System.Text.Encoding.Unicode.GetString(b);
VB.NET
Dim strModified As String = System.Text.Encoding.Unicode.GetString(b)
Convert a String to Byte[] (Byte Array)
C#
byte[] b = Encoding.Unicode.GetBytes(strOriginal);VB.NET
Dim b As Byte() = Encoding.Unicode.GetBytes(strOriginal)
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
2 Responses to "Convert Byte[] (Byte Array) to String and ViceVersa"For a round trip byte[] -> string -> byte[], you are much safer using Convert.ToBase64String and FromBase64String
Nice one John!!
thks
Post a Comment