i need to convert string to ascii....like i need to convert hello to ascii value and also convert that ascii value back again to hello.
please guide me regarding code. thanks
From http://msdn.microsoft.com/en-us/library/system.text.encoding.convert%28VS.71%29.aspx
string value = "9quali52ty3";// Convert the string into a byte[].byte[] asciiBytes = Encoding.ASCII.GetBytes(value);
protected void Page_Load(object sender, EventArgs e) { string s = "hello"; StringBuilder result = new StringBuilder(); foreach (char c in s) { if (Char.IsLetter(c)) { string str = System.Convert.ToInt32(c).ToString() + " "; result.Append(str); } } Response.Write("Result:" + result);
}