|
-
Dec 11th, 2002, 12:29 PM
#1
Thread Starter
Lively Member
Equivilent of VB's Chr$()
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
-
Dec 11th, 2002, 01:17 PM
#2
Frenzied Member
Dont gain the world and lose your soul
-
Dec 11th, 2002, 04:05 PM
#3
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 11th, 2002, 08:58 PM
#4
Frenzied Member
number.ToString() simply return a string representation of the number. He wants to convert the number to its matching character.
Dont gain the world and lose your soul
-
Dec 12th, 2002, 10:32 AM
#5
Oh, in that case that would be
((char)number).ToString()
e.g.
((char)65).ToString()
results in "A"
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|