关于判断汉字为字母的问题 有什么方法可以判断 汉字的第一字的大写字母是什么 例如: string a = "你好"; 显示 A = "N";有没有这个方法或者代码啊/ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private string getSpell(string cnChar){ byte[] arrCN = Encoding.Default.GetBytes(cnChar); if (arrCN.Length > 1) { int area = (short)arrCN[0]; int pos = (short)arrCN[1]; int code = (area << 8) + pos; int[] areacode = { 45217, 45253, 45761, 46318, 46826, 47010, 47297, 47614, 48119, 48119, 49062, 49324, 49896, 50371, 50614, 50622, 50906, 51387, 51446, 52218, 52698, 52698, 52698, 52980, 53689, 54481 }; for (int i = 0; i < 26; i++) { int max = 55290; if (i != 25) max = areacode[i + 1]; if (areacode[i] <= code && code < max) { return Encoding.Default.GetString(new byte[] { (byte)(65 + i) }); } } return "* "; } else return cnChar;} checkboxlist注册事件的问题 三元表达式效率更高吗? 小白的问题,关于文本框 请教,这样表格的形式,大家是怎么实现的? 我是初学者,请高手帮忙,我要修改。。。。。请各位高手帮忙 怎样知道网站的后台管理页面 把带有html代码的值保存进数据库时出错! 如何将SQL数据导出到DBF gridview的显示问题 存储过程怎么分页 懂Flash和js的请进,基础问题 将EXECL文件另存为 CSV 文件格式再上传到数据库怎么办?
{
byte[] arrCN = Encoding.Default.GetBytes(cnChar);
if (arrCN.Length > 1)
{
int area = (short)arrCN[0];
int pos = (short)arrCN[1];
int code = (area << 8) + pos;
int[] areacode = { 45217, 45253, 45761, 46318, 46826, 47010, 47297, 47614, 48119, 48119, 49062, 49324, 49896, 50371, 50614, 50622, 50906, 51387, 51446, 52218, 52698, 52698, 52698, 52980, 53689, 54481 };
for (int i = 0; i < 26; i++)
{
int max = 55290;
if (i != 25) max = areacode[i + 1];
if (areacode[i] <= code && code < max)
{
return Encoding.Default.GetString(new byte[] { (byte)(65 + i) });
}
}
return "* ";
}
else return cnChar;
}