public static int GetASCII(string strChar)
{
if (strChar.Length > 0)
{
System.Text.ASCIIEncoding objAscii = new System.Text.ASCIIEncoding();
return (int)objAscii.GetBytes(strChar)[0];
}
else
{
return -1;
}
}
public static string GetCharFromASCII(int intAsciiValue)
{
if (intAsciiValue <= 255)
{
System.Text.ASCIIEncoding objAscii = new System.Text.ASCIIEncoding();
return objAscii.GetString(new byte[] { (byte)intAsciiValue });
}
else
{
return "Not a valid ASCII value";
}
}
>string str_qoutation = GetCharFromASCII(34);
****
Isn't this just
string str_quotation = "\"";
?
****
****
Is this a C# question? This is an MFC newsgroup...
This seems a remarkably complex way to accomplish something simple.
joe
****
> }
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm