Say you have this in VB:
Dim i As Integer
i = 65
Msgbox(Chr$(i))
this will pop up "A". How do I do this in C#?
Thanks,
AnT
Printable View
Say you have this in VB:
Dim i As Integer
i = 65
Msgbox(Chr$(i))
this will pop up "A". How do I do this in C#?
Thanks,
AnT
Try this
Code:Convert.ToChar();
To get a string out of an ASCII code (that's what Chr$ does I think) you'd do
Convert.ToString(number)
or simply
number.ToString()
given it is already available as an IntXX object.
number.ToString() simply return a string representation of the number. He wants to convert the number to its matching character.
Oh, in that case that would be
((char)number).ToString()
e.g.
((char)65).ToString()
results in "A"