convert a number to its ascii value

  • Thread starter Thread starter questions
  • Start date Start date
Q

questions

How do I convert a number to its ascii value in c#?
What is the equivalent of VB's chr() function in c#?

thanks in advance
 
questions said:
How do I convert a number to its ascii value in c#?
What is the equivalent of VB's chr() function in c#?

Just cast it to an int, or assign it to an int variable.
 
questions said:
How do I convert a number to its ascii value in c#?
What is the equivalent of VB's chr() function in c#?

Sorry, my previous answer was character -> Unicode value. To get from
Unicode value -> character, just cast to char:

int i = 65;

char c = (char) i; // c now equals 'A'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top