【发布时间】:2014-03-24 23:51:45
【问题描述】:
我必须开发一个Windows Mobile C# app 来比较字符并获取ascii 码
这是我的伪代码:
public void getAscii(char c)
{
int ascii_n = c.GetAscii(); //or something that gives me the hexadec number
//You know; a=97, b=98...
if (ascii_n > 12 && ascii_n < 23)
{
//code lines
}
else if (ascii_n > 24 && ascii_n < 55)
{
//more code lines
}
}
知道我该怎么做吗??
【问题讨论】:
-
非ASCII字符,即Unicode字符,你想做什么?
-
没什么!我将只比较
a-z、A-Z和0-9 -
所以,你想忽略'!`?
-
请注意,此功能已经在框架中以
Char.IsUpper、Char.IsLower和Char.IsDigit的形式提供。