怎样取得汉字首字母
来源:互联网 发布:女士鞋包淘宝网 编辑:程序博客网 时间:2024/04/30 13:17
static public string GetChineseSpell(string strText)
{
int len = strText.Length;
string myStr = "";
for(int i=0;i<len;i++)
{
myStr += getSpell(strText.Substring(i,1));
}
return myStr;
}
static public 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;
}
- 怎样取得汉字首字母
- 取得汉字拼音首字母
- 取得汉字的首字母
- 取得汉字拼音首字母函数,取得汉字串首字母
- 取得汉字的拼音首字母
- Excel 取得汉字拼音首字母
- c#取得汉字的拼音的首字母。
- C#取得汉字的拼音的首字母。
- 取得汉字字符串的首字母串
- c#取得汉字的拼音的首字母
- C#取得汉字的拼音的首字母
- c#取得汉字的拼音的首字母
- C#取得汉字的拼音的首字母
- C#取得汉字的拼音的首字母
- c#取得汉字的拼音的首字母
- C#取得汉字的拼音的首字母
- 取得给定汉字串的首字母串
- 取得给定汉字串的首字母串
- 怎样给U盘添加背景图片
- 转:VXD,KMD,WDM基本概念 (5千字)发信人:1212时 间:2001-11-12 14:52:00 详细信息:VXD,KMD,WDM基本概念 作者:陆麟 来来来,一起进入这黑黑的驱动程序世界.:) 这里要讲的是Vxd,Kernel Mode Dr
- 关于内核线程(kernel_thread)
- 哈弗大学的校训——值得一思!!
- 两种tab页选项卡的做法
- 怎样取得汉字首字母
- 常用的javascript表单验证函数
- css滤镜效果
- 人与人之间的良好关系是建立在宽容基础之上的
- ASP.NET 2.0 repeater控件实现多列完美显示
- slickedit相关资料收集
- VS2005配置IDE设置的两种方式
- 自定屏保快捷键
- JSON简介