Hi sir,
How can string can be converted to byte array and viceversa ?
could you please reply this soon..
Binary File
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 21, 2013, 5:34 AM EDT
try it
VulpesRank #55 · 29.2K reputationPosted Jun 21, 2013, 9:59 AM EDT
In .NET all strings are stored in Unicode format (normally 2 bytes per character) and the following program shows how you can convert a string to a byte array and back again using this encoding:
Console.ReadKey();
The output is: