Thursday 19 December 2013

How to Convert String to ASCII Format and ASCII Format to String Format in C#

 string a = "abc";
 byte[] asciiBytes = Encoding.ASCII.GetBytes(a);
 for (int i = 0; i < a.Length; i++)
 {
       int b = asciiBytes[i];                         // string to ascii value
       string sssss = ((char)b).ToString();   // ascii value to string        
 }


No comments:

Post a Comment