Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
UnicodeEncoding utf16 = new UnicodeEncoding();

string saltValueString = utf16.GetString(saltValue); // string to byte[]

How do I do for byte[] to string?
Posted
Comments
Alan N 19-Jul-14 10:49am    
Well I'd read the documentation for the UnicodeEncoding class.
[no name] 19-Jul-14 10:50am    
It would be exactly the same way that you have already been told.
Sergey Alexandrovich Kryukov 19-Jul-14 22:59pm    
What prevents you from reading original MSDN documentation? Or at least reading the answers and comments you already received? I cannot decide on answering you just because I'm afraid you are not understanding answers. Perhaps you need to read documentation on Unicode to understand what is that.
—SA

C#
byte[] b = new byte[1024];
string test = System.Text.Encoding.ASCII.GetString(b);
 
Share this answer
 
v2
Comments
[no name] 19-Jul-14 22:26pm    
5ed.
use System.Text.Encoding.&ltUnicodeEncoding>.GetString( your byte array)
note UnicodeEncoding should your byte array encoding type

for example
C#
string stringvalue = System.Text.Encoding.UTF8.GetString(byteArr);
 
Share this answer
 

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