Hi all,
How can I convert a unicode value to its relevant integer value and print it.
For Example:
When I enter 49(unicode), it's equivalent integer value 1 should be printed.
How can I achieve this?
Please help!!
Thanks in advace..
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Oct 22, 2013, 12:18 AM
try following code
int charvalue = 49;
var original = Convert.ToInt16(((char)charvalue).ToString());
hope this will help you.
VulpesPosted Oct 21, 2013, 2:49 PM
For example:
for(int i = 48; i < 58; i++)
{
Console.Write((char)i);
}
produces output of: 0123456789