How To Convert A Number To an ASCII Character?

后端 未结 6 1169
礼貌的吻别
礼貌的吻别 2020-12-17 09:45

I want to create an application where user would input a number and the program will throw back a character to the user.

Edit: How about vice versa, changing a ascii

6条回答
  •  悲&欢浪女
    2020-12-17 10:17

    I was googling about how to convert an int to char, that got me here. But my question was to convert for example int of 6 to char of '6'. For those who came here like me, this is how to do it:

    int num = 6;
    num.ToString().ToCharArray()[0];
    

提交回复
热议问题