文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > vc中实现获取汉字拼音的首字母
侵权投诉

vc中实现获取汉字拼音的首字母

vc中实现获取汉字拼音的首字母

在vc中实现获取汉字拼音的首字母 默认分类 2009-03-02 23:15:12 阅读192 评论0 字号:大中小 订阅

Author: lixiaosan

Date: 05/26/2006

/******************************************************************************************** /* Syntax

/* GetFirstLetter(CString strName, CString& strFirstLetter)

/* Remarks:

/* Get the first letter of pinyin according to specified Chinese character. /* Parameters:

/* strName - a CString object that is to be parsed.

/* strFirstLetter - a CString object that is to receive the string of the first letter. /* Return Values:

/* None.

/* Author:

/* lixiaosan

/* Create Date:

/* 05-26-2006

/******************************************************************************************** void GetFirstLetter(CString strName, CString& strFirstLetter)

{

TBYTE ucHigh, ucLow;

int nCode;

CString strRet;

strFirstLetter.Empty();

for (int i=0; i<strName.GetLength(); i++)

{

if ( (TBYTE)strName[i] < 0x80 )

continue;

ucHigh = (TBYTE)strName[i];

ucLow = (TBYTE)strName[i+1];

if ( ucHigh < 0xa1 || ucLow < 0xa1)

continue;

else

// Treat code by section-position as an int type parameter,

// so make following change to nCode.

nCode = (ucHigh - 0xa0) * 100 + ucLow - 0xa0;

FirstLetter(nCode, strRet);

第1页

你可能喜欢

  • 模糊查询
  • 汉字拼音
  • 26个拼音字母
  • 汉语拼音字母
  • 幼儿拼音字母
  • 拼音字母表读法

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email