Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

qoutation solution

1 view
Skip to first unread message

aliziveie

unread,
Oct 16, 2008, 4:53:38 AM10/16/08
to
string str_qoutation = GetCharFromASCII(34);

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";
}
}

Joseph M. Newcomer

unread,
Oct 16, 2008, 2:28:11 PM10/16/08
to
See below...
On Thu, 16 Oct 2008 01:53:38 -0700, ali ziveie wrote:

>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

0 new messages