How to convert Ascii value to character in c#? -
this question has answer here:
- how character given ascii value 7 answers
i have ascii value stored int , want ascii convert character.
private void button2_click(object sender, eventargs e) { string text3 = textbox1.text; string text4 = ""; byte[] array = encoding.ascii.getbytes(text3); foreach (char c in array) { int ascii = (int)c; ascii = ((((ascii / 37 + 657) / 12) - 582) / 11); text4 += ascii + "-"; } textbox3.text = text4; }
this simplest way of converting ascii value character , string:
int = 123; char c = (char)i; string s = c.tostring();
in example should work following:
text4 += (char)ascii + "-";
Comments
Post a Comment