Answers
Mar 10, 2009 - 03:09 AM
Do u want to find a ascii value of a single character or a string?
Here is a simple example of converting a string to ascii values
I output the single character in the string on the console.
The combined ascii values is shown via a message box
String sSource = "priya";// Specify source string
String sResult = "";// Save result here
// Iterate thru each individual character
foreach (char c in sSource)
{
Console.WriteLine((byte)c);// Dump that ascii value to the console
sResult = sResult + (byte)c;
}
MessageBox.Show (sResult);// Show combined ascii values to user
Here is a simple example of converting a string to ascii values
I output the single character in the string on the console.
The combined ascii values is shown via a message box
String sSource = "priya";// Specify source string
String sResult = "";// Save result here
// Iterate thru each individual character
foreach (char c in sSource)
{
Console.WriteLine((byte)c);// Dump that ascii value to the console
sResult = sResult + (byte)c;
}
MessageBox.Show (sResult);// Show combined ascii values to user
Mar 20, 2009 - 04:22 AM
Thankyou Nidhi.can u tell me how to findout ascii value for a single character?
Mar 20, 2009 - 05:18 AM
If u want to check a character you could try this
int i;
char letter;
letter='A';
i = (int)letter;
int i;
char letter;
letter='A';
i = (int)letter;
Apr 11, 2009 - 07:48 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
The Quomon Team
Add New Comment