搜档网
当前位置:搜档网 › 汉字转换拼音或拼音首字母(两个函数)

汉字转换拼音或拼音首字母(两个函数)

汉字转换拼音或拼音首字母(两个函数)
汉字转换拼音或拼音首字母(两个函数)

/*

根据汉字获取全拼

1.生成所有读音临时表

2.根据Chinese_PRC_CS_AS_KS_WS 排序获取读音

*/

create function f_GetPy(@str varchar(100))

returns varchar(8000)

as

begin

declare @re varchar(8000)

–生成临时表

declare @t table(chr nchar(1) collate Chinese_PRC_CS_AS_KS_WS,py nvarchar(20)) insert into @t select’吖’,'a’

insert into @t select’厑’,'aes’

insert into @t select’哎’,'ai’

insert into @t select’安’,'an’

insert into @t select’肮’,'ang’

insert into @t select’凹’,'ao’

insert into @t select’八’,'ba’

insert into @t select’挀’,'bai’

insert into @t select’兡’,'baike’

insert into @t select’瓸’,'baiwa’

insert into @t select’扳’,'ban’

insert into @t select’邦’,'bang’

insert into @t select’勹’,'bao’

insert into @t select’萡’,'be’

insert into @t select’陂’,'bei’

insert into @t select’奔’,'ben’

insert into @t select’伻’,'beng’

insert into @t select’皀’,'bi’

insert into @t select’边’,'bian’

insert into @t select’辪’,'uu’

insert into @t select’灬’,'biao’

insert into @t select’憋’,'bie’

insert into @t select’汃’,'bin’

insert into @t select’冫’,'bing’

insert into @t select’癶’,'bo’

insert into @t select’峬’,'bu’

insert into @t select’嚓’,'ca’

insert into @t select’偲’,'cai’

insert into @t select’乲’,'cal’

insert into @t select’参’,'can’

insert into @t select’撡’,'cao’insert into @t select’冊’,'ce’insert into @t select’膥’,'cen’insert into @t select’噌’,'ceng’insert into @t select’硛’,'ceok’insert into @t select’岾’,'ceom’insert into @t select’猠’,'ceon’insert into @t select’乽’,'ceor’insert into @t select’叉’,'cha’insert into @t select’犲’,'chai’insert into @t select’辿’,'chan’insert into @t select’伥’,'chang’insert into @t select’抄’,'chao’insert into @t select’车’,'che’insert into @t sel ect’抻’,'chen’insert into @t select’阷’,'cheng’insert into @t select’吃’,'chi’insert into @t select’充’,'chong’insert into @t select’抽’,'chou’insert into @t select’出’,'chu’insert into @t select’膗’,'chuai’insert into @t select’巛’,'chuan’insert i nto @t select’刅’,'chuang’insert into @t select’吹’,'chui’insert into @t select’旾’,'chun’insert into @t select’踔’,'chuo’insert into @t select’呲’,'ci’insert into @t select’嗭’,'cis’insert into @t select’从’,'cong’insert into @t select’凑’,'cou’

in sert into @t select’粗’,'cu’insert into @t select’汆’,'cuan’insert into @t select’崔’,'cui’insert into @t select’邨’,'cun’insert into @t select’瑳’,'cuo’insert into @t select’撮’,'chua’insert into @t select’咑’,'da’insert into @t select’呔’,'dai’

in sert into @t select’丹’,'dan’insert into @t select’当’,'dang’insert into @t select’刀’,'dao’

insert into @t select’揼’,'dem’insert into @t select’扥’,'den’insert into @t select’灯’,'deng’insert into @t select’仾’,'di’

in sert into @t select’嗲’,'dia’insert into @t select’敁’,'dian’insert into @t select’刁’,'diao’insert into @t select’爹’,'die’insert into @t select’哋’,'dei’insert into @t select’嚸’,'dim’insert into @t select’丁’,'ding’insert into @t select’丟’,'diu’insert into @t select’东’,'dong’insert into @t select’吺’,'dou’insert into @t select’剢’,'du’insert into @t select’耑’,'duan’insert into @t select’叾’,'dug’insert into @t select’垖’,'dui’insert into @t select’吨’,'dun’insert into @t select’咄’,'duo’insert into @t select’妸’,'e’insert into @t select’奀’,'en’insert into @t select’鞥’,'eng’insert into @t select’仒’,'eo’insert into @t select’乻’,'eol’insert into @t select’旕’,'eos’insert into @t select’儿’,'er’insert into @t select’发’,'fa’inse rt into @t select’帆’,'fan’insert into @t select’匚’,'fang’insert into @t select’飞’,'fei’insert into @t select’吩’,'fen’insert into @t select’丰’,'feng’insert into @t select’瓰’,'fenwa’insert into @t select’覅’,'fiao’insert into @t select’仏’,'fo’insert into @t select’垺’,'fou’insert into @t select’夫’,'fu’insert into @t select’猤’,'fui’insert into @t select’旮’,'ga’insert into @t select’侅’,'gai’

insert into @t select’冈’,'gang’insert into @t select’皋’,'gao’

i nsert into @t select’戈’,'ge’insert into @t select’给’,'gei’insert into @t select’根’,'gen’insert into @t select’更’,'geng’insert into @t select’啹’,'geu’insert into @t select’喼’,'gib’insert into @t select’嗰’,'go’insert into @t select’工’,'gong’

i nsert into @t select’兝’,'gongfen’insert into @t select’兣’,'gongli’insert into @t select’勾’,'gou’insert into @t select’估’,'gu’insert into @t select’瓜’,'gua’insert into @t select’乖’,'guai’insert into @t select’关’,'guan’insert into @t select’光’,'guang’insert into @t select’归’,'gui’insert into @t select’丨’,'gun’insert into @t select’呙’,'guo’insert into @t select’妎’,'ha’insert into @t select’咍’,'hai’insert into @t select’乤’,'hal’insert into @t select’兯’,'han’insert into @t select’魧’,'hang’insert into @t select’茠’,'hao’insert into @t select’兞’,'haoke’insert into @t select’诃’,'he’insert into @t select’黒’,'hei’insert into @t select’拫’,'hen’insert into @t select’亨’,'heng’insert into @t select’囍’,'heui’insert into @t selec t’乊’,'ho’insert into @t select’乥’,'hol’insert into @t select’叿’,'hong’insert into @t select’齁’,'hou’insert into @t select’乎’,'hu’insert into @t select’花’,'hua’insert into @t select’徊’,'huai’insert into @t select’欢’,'huan’

insert into @t select’灰’,'hui’insert into @t select’昏’,'hun’insert into @t select’吙’,'huo’insert into @t select’嚿’,'geo’insert into @t select’夻’,'hwa’insert into @t select’丌’,'ji’insert into @t select’加’,'jia’insert into @t sel ect’嗧’,'jialun’insert into @t select’戋’,'jian’insert into @t select’江’,'jiang’insert into @t select’艽’,'jiao’insert into @t select’阶’,'jie’insert into @t select’巾’,'jin’insert into @t select’坕’,'jing’insert into @t select’冂’,'jiong’insert i nto @t select’丩’,'jiu’insert into @t select’欍’,'jou’insert into @t select’凥’,'ju’insert into @t select’姢’,'juan’insert into @t select’噘’,'jue’insert into @t select’军’,'jun’insert into @t select’咔’,'ka’insert into @t select’开’,'kai’insert in to @t select’乫’,'kal’insert into @t select’刊’,'kan’insert into @t select’冚’,'hem’insert into @t select’砊’,'kang’insert into @t select’尻’,'kao’insert into @t select’坷’,'ke’insert into @t select’肎’,'ken’insert into @t select’劥’,'keng’insert i nto @t select’巪’,'keo’insert into @t select’乬’,'keol’insert into @t select’唟’,'keos’insert into @t select’厼’,'keum’insert into @t select’怾’,'ki’insert into @t select’空’,'kong’insert into @t select’廤’,'kos’insert into @t select’抠’,'kou’inser t into @t select’扝’,'ku’insert into @t select’夸’,'kua’

insert into @t select’宽’,'kuan’insert into @t select’匡’,'kuang’insert into @t select’亏’,'kui’insert into @t select’坤’,'kun’insert into @t select’拡’,'kuo’

in sert into @t select’穒’,'kweok’insert into @t select’垃’,'la’insert into @t select’来’,'lai’insert into @t select’兰’,'lan’insert into @t select’啷’,'lang’insert into @t select’捞’,'lao’insert into @t select’仂’,'le’insert into @t select’雷’,'lei’

i nsert into @t select’塄’,'leng’insert into @t select’唎’,'li’

insert into @t select’俩’,'lia’insert into @t select’嫾’,'lian’insert into @t select’簗’,'liang’insert into @t select’蹽’,'liao’insert into @t select’毟’,'lie’insert into @t select’厸’,'lin’insert into @t select’伶’,'ling’insert into @t select’溜’,'liu’insert into @t select’瓼’,'liwa’insert into @t select’囖’,'lo’insert into @t select’龙’,'long’insert into @t select’娄’,'lou’insert into @t select’噜’,'lu’insert into @t select’驴’,'lv’insert into @t select’寽’,'lue’insert into @t select’孪’,'luan’insert into @t select’掄’,'lun’insert into @t select’頱’,'luo’insert into @t select’呣’,'m’insert into @t select’妈’,'ma’insert into @t select’遤’,'hweong’insert into @t select’埋’,'mai’insert into @t select’颟’,'man’insert into @t select’牤’,'mang’insert into @t select’匁’,'mangmi’insert into @t select’猫’,'mao’

insert into @t select’庅’,'me’insert into @t select’呅’,'mei’insert into @t select’椚’,'men’insert into @t select’掹’,'meng’insert into @t select’踎’,'meo’insert into @t select’瞇’,'mi’

insert into @t select’宀’,'mian’insert into @t select’喵’,'miao’insert into @t select’乜’,'mie’insert into @t select’瓱’,'miliklanm’insert into @t se lect’民’,'min’insert into @t select’冧’,'lem’insert into @t select’名’,'ming’insert into @t select’谬’,'miu’insert into @t select’摸’,'mo’insert into @t select’乮’,'mol’insert into @t select’哞’,'mou’insert into @t select’母’,'mu’insert into @t sel ect’旀’,'myeo’insert into @t select’丆’,'myeon’insert into @t select’椧’,'myeong’insert into @t select’拏’,'na’

insert into @t select’腉’,'nai’insert into @t select’囡’,'nan’insert into @t select’囔’,'nang’insert into @t select’乪’,'keg’insert into @t select’孬’,'nao’insert into @t select’疒’,'ne’

insert into @t select’娞’,'nei’insert into @t select’焾’,'nem’insert into @t select’嫩’,'nen’insert into @t select’莻’,'neus’insert into @t select’鈪’,'ngag’insert into @t select’銰’,'ngai’insert int o @t select’啱’,'ngam’insert into @t select’妮’,'ni’

insert into @t select’年’,'nian’insert into @t select’娘’,'niang’insert into @t select’茑’,'niao’insert into @t select’捏’,'nie’insert into @t select’脌’,'nin’

inser t into @t select’牛’,'niu’insert into @t select’农’,'nong’insert into @t select’羺’,'nou’insert into @t select’奴’,'nu’insert into @t select’女’,'nv’

insert into @t select’疟’,'nue’insert into @t select’瘧’,'nve’insert into @t select’奻’,'nuan’inser t into @t select’黁’,'nun’insert into @t select’燶’,'nung’insert into @t select’挪’,'nuo’insert into @t select’筽’,'o’

insert into @t select’夞’,'oes’insert into @t select’乯’,'ol’

insert into @t select’鞰’,'on’insert into @t select’讴’,'ou’

insert in to @t select’妑’,'pa’insert into @t select’俳’,'pai’insert into @t select’磗’,'pak’insert into @t select’眅’,'pan’insert into @t select’乓’,'pang’insert into @t select’抛’,'pao’insert into @t select’呸’,'pei’insert into @t select’瓫’,'pen’insert in to @t select’匉’,'peng’insert into @t select’浌’,'peol’insert into @t select’巼’,'phas’insert into @t select’闏’,'phdeng’insert into @t select’乶’,'phoi’insert into @t select’喸’,'phos’insert into @t select’丕’,'pi’

insert into @t select’囨’,'pian’

i nsert into @t select’缥’,'piao’insert into @t select’氕’,'pie’insert into @t select’丿’,'pianpang’insert into @t select’姘’,'pin’insert into @t select’乒’,'ping’insert into @t select’钋’,'po’insert into @t select’剖’,'pou’insert into @t select’哣’,'deo’insert into @t select’兺’,'ppun’

insert into @t select’七’,'qi’insert into @t select’掐’,'qia’insert into @t select’千’,'qian’insert into @t select’羌’,'qiang’insert into @t select’兛’,'qianke’insert into @t select’瓩’,'qianwa’insert into @t select’悄’,'qiao’insert into @t select’苆’,'qie’insert into @t select’亲’,'qin’insert into @t select’蠄’,'kem’insert into @t select’氢’,'qing’insert into @t select’銎’,'qiong’insert into @t select’丘’,'qiu’insert into @t select’曲’,'qu’insert into @t select’迲’,'keop’insert into @t select’峑’,'quan’insert into @t select’蒛’,'que’insert into @t select’夋’,'qun’insert into @t select’亽’,'ra’insert into @t select’囕’,'ram’insert into @t select’呥’,'ran’insert into @t select’穣’,'rang’insert into @t select’荛’,'rao’insert into @t select’惹’,'re’insert into @t select’人’,'ren’insert into @t select’扔’,'reng’insert into @t select’日’,'ri’insert into @t select’栄’,'rong’insert into @t select’禸’,'rou’insert into @t select’嶿’,'ru’insert into @t select’撋’,'ruan’insert into @t select’桵’,'rui’insert into @t select’闰’,'run’insert into @t select’叒’,'ruo’insert into @t select’仨’,'sa’insert into @t select’栍’,'saeng’insert into @t select’毢’,'sai’insert into @t select’虄’,'sal’insert into @t select’三’,'san’insert into @t select’桒’,'sang’insert into @t select’掻’,'sao’

insert into @t select’裇’,'sed’insert into @t select’聓’,'sei’insert into @t select’森’,'sen’insert into @t select’鬙’,'seng’insert into @t select’閪’,'seo’insert into @t select’縇’,'seon’insert into @t select’杀’,'sha’insert into @t select’筛’,'shai’insert into @t select’山’,'shan’insert into @t select’伤’,'shang’insert into @t select’弰’,'shao’insert into @t select’奢’,'she’insert into @t select’申’,'shen’insert into @t select’升’,'sheng’insert into @t select’尸’,'shi’insert into @t select’兙’,'shike’insert into @t select’瓧’,'shiwa’insert into @t select’収’,'shou’insert into @t select’书’,'shu’insert into @t select’刷’,'shua’insert into @t select’摔’,'shuai’insert into @t select’闩’,'shuan’insert into @t select’双’,'shuang’insert into @t select’谁’,'shei’insert into @t select’脽’,'shui’insert into @t select’吮’,'shun’insert into @t sele ct’哾’,'shuo’insert into @t select’丝’,'si’insert into @t select’螦’,'so’insert into @t select’乺’,'sol’insert into @t select’忪’,'song’insert into @t select’凁’,'sou’insert into @t select’苏’,'su’insert into @t select’痠’,'suan’insert into @t sele ct’夊’,'sui’insert into @t select’孙’,'sun’insert into @t select’娑’,'suo’insert into @t select’他’,'ta’insert into @t select’襨’,'tae’insert into @t select’囼’,'tai’insert into @t select’坍’,'tan’

insert into @t sele ct’仐’,'tao’insert into @t select’畓’,'tap’insert into @t select’忒’,'te’insert into @t select’膯’,'teng’insert into @t select’唞’,'teo’insert into @t select’朰’,'teul’insert into @t select’剔’,'ti’insert into @t select’天’,'tian’insert into @t sel ect’旫’,'tiao’insert into @t select’怗’,'tie’insert into @t select’厅’,'ting’insert into @t select’乭’,'tol’insert into @t select’囲’,'tong’insert into @t select’偷’,'tou’insert into @t select’凸’,'tu’insert into @t select’湍’,'tuan’insert into @t select’推’,'tui’insert into @t select’旽’,'tun’insert into @t select’乇’,'tuo’insert into @t select’屲’,'wa’insert into @t select’歪’,'wai’insert into @t select’乛’,'wan’insert into @t select’尣’,'wang’insert into @t select’危’,'wei’insert into @t select’塭’,'wen’insert into @t select’翁’,'weng’insert into @t select’挝’,'wo’insert into @t select’乌’,'wu’insert into @t select’夕’,'xi’insert into @t select’诶’,'ei’insert into @t select’疨’,'xia’insert into @t select’仙’,'xian’insert into @t se lect’乡’,'xiang’insert into @t select’灱’,'xiao’insert into @t select’楔’,'xie’insert into @t select’心’,'xin’insert into @t select’星’,'xing’insert into @t select’凶’,'xiong’insert into @t select’休’,'xiu’insert into @t select’旴’,'xu’insert into @t select’昍’,'xuan’

insert into @t select’坃’,'xun’insert into @t select’丫’,'ya’insert into @t select’咽’,'yan’insert into @t select’欕’,'eom’insert into @t select’央’,'yang’insert into @t select’吆’,'yao’insert into @t select’椰’,'ye’insert into @t select’膶’,'yen’insert into @t select’一’,'yi’insert into @t select’乁’,'i’insert into @t select’乚’,'yin’insert into @t select’应’,'ying’insert into @t select’哟’,'yo’insert into @t select’佣’,'yong’insert into @t select’优’,'you’insert into @t select’迂’,'yu’insert into @t select’囦’,'yuan’insert into @t select’曰’,'yue’insert into @t select’蒀’,'yun’insert into @t select’帀’,'za’insert into @t select’災’,'zai’insert into @t select’兂’,'zan’insert into @t select’牂’,'zang’insert into @t select’遭’,'zao’insert into @t select’啫’,'ze’insert into @t select’贼’,'zei’insert into @t select’怎’,'zen’insert into @t select’曽’,'zeng’insert into @t select’吒’,'zha’insert into @t select’甴’,'gad’insert into @t select’夈’,'zhai’insert into @t select’毡’,'zhan’insert into @t select’张’,'zhang’insert into @t select’钊’,'zhao’insert into @t select’蜇’,'zhe’insert into @t select’贞’,'zhen’insert into @t select’凧’,'zheng’insert into @t select’之’,'zhi’insert into @t select’中’,'zhong’insert into @t select’州’,'zhou’insert into @t select’劯’,'zhu’

insert into @t select’专’,'zhuan’

insert into @t select’转’,'zhuai’

insert into @t select’妆’,'zhuang’

insert into @t select’骓’,'zhui’

insert into @t select’宒’,'zhun’

insert into @t select’卓’,'zhuo’

insert into @t select’孜’,'zi’

insert into @t select’唨’,'zo’

insert into @t select’宗’,'zong’

insert into @t select’棸’,'zou’

insert into @t select’哫’,'zu’

insert into @t select’劗’,'zuan’

insert into @t select’厜’,'zui’

insert into @t select’尊’,'zun’

insert into @t select’昨’,'zuo’

declare @strlen int

select @strlen=len(@str),@re=”

while @strlen>0

begin

select top 1 @re=UPPER(substring(py,1,1) )+substring(py,2,len(py))+@re,@strlen=@strlen-1 from @t a where chr<=substring(@str,@strlen,1)

order by chr collate Chinese_PRC_CS_AS_KS_WS desc

if @@rowcount=0

select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1

end

return(@re)

end

go

declare @pin varchar(40)

exec @pin=dbo.f_GetPy’方海华’

print @pin

go

–排序规则

select * from ::fn_helpcollations()

print @@rowcount

-----------------------------------------------------------------------------

/*

汉字转拼音首字母

*/

create function fun_getPY(@str nvarchar(4000))

returns nvarchar(4000)

as

begin

declare @word nchar(1),@PY nvarchar(4000)

set @PY=”

while len(@str)>0

begin

set @word=left(@str,1)

–如果非汉字字符,返回原字符

set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901 then (select top 1 PY from (

select ‘A’ as PY,N’驁’ as word

union all select ‘B’,N’簿’

union all select ‘C’,N’錯’

union all select ‘D’,N’鵽’

union all select ‘E’,N’樲’

union all select ‘F’,N’鰒’

union all select ‘G’,N’腂’

union all select ‘H’,N’夻’

union all select ‘J’,N’攈’

union all select ‘K’,N’穒’

union all select ‘L’,N’鱳’

union all select ‘M’,N’旀’

union all select ‘N’,N’桛’

union all select ‘O’,N’漚’

union all select ‘P’,N’曝’

union all select ‘Q’,N’囕’

union all select ‘R’,N’鶸’

union all select ‘S’,N’蜶’

union all select ‘T’,N’籜’

union all select ‘W’,N’鶩’

union all select ‘X’,N’鑂’

union all select ‘Y’,N’韻’

union all select ‘Z’,N’咗’

) T

where word>=@word collate Chinese_PRC_CS_AS_KS_WS

order by PY ASC) else @word end)

set @str=right(@str,len(@str)-1)

end

return @PY

end

c语言汉字转拼音函数源码

c语言汉字转拼音函数源码 在做一些MIS系统,尤其是人事相关的系统时,通常会用到需要将用户的姓名,转成汉语拼音的情形。现在,把这个的实现分享出来,源代码来源网上,由于是很早收集的,原作者已不详,就不标注了。核心代码如下: /// <summary> /// 完整转换函数,输出全拼的结果 /// </summary> /// <param name="CnString">传入的中文字符串 </param> /// <returns>转换出的拼音组合</returns> public static string FullConvert(string CnString) { byte[] btArray = new byte[2]; int cAscii = 0; short idx1, idx2; StringBuilder sbResult = new StringBuilder(); ch ar[] tempCArray = CnString.ToCharArray(); for (int idx = 0; idx < tempCArray.Length; idx++) { btArray =

Encoding.Default.GetBytes(tempCArray[idx].ToString()); if (btArray.Length == 1) sbResult.Append(tempCArray[idx]); else { idx1 = (short)btArray[0]; idx2 = (short)btArray[1]; cAscii = idx1 * 256 + idx2 - 65536; if (cAscii > 0 && cAscii < 160) sbResult.Append(tempCArray[idx]); else { for (int i = pyValueArr.Length - 1; i >= 0; i--) { if (pyValueArr[i] <= cAscii) { sbResult.Append(pyCharacterArr[i]); break; }

宏-汉字转换拼音

公司要建DataBase,为了让老外们看明白,所以要吧中文店名全部转换成拼音。 5000多家,搞得头好晕,所以请教了下高手,发现了VBA的一个小技巧,分享给大家, 希望大家有用哦::P 具体方法如下: 打开Excel->Tools->Macro(宏)->Viaual Basic编辑器 点击插入->Module(模块) 然后会出现一个Module1,空白栏中粘贴以下内容: Option Explicit Option Compare Text Public Function HZQP(expression As String, Optional delimiter As String = " ", Optional limit As Integer = -1) As String 'expression ' 必需的?包含要转换的字符串? 'delimiter ' 可选的。用于标识分隔拼音的字符串字符。如果忽略,则使用空格字符(" ")作为分隔符。如果delimiter是一个长度为零的字符串,则返回仅包含一个元素,即完整的expression字符串。 'limit ' 可选的。要返回拼音字符数,–1表示返回所有的拼音字符数,1表示返回拼音首字母。 Dim STR As String, arrWord(400) As String Dim i As Integer, j As Integer arrWord(1) = "吖a" arrWord(2) = "哎ai" arrWord(3) = "腤an" arrWord(4) = "肮ang" arrWord(5) = "凹ao" arrWord(6) = "八ba" arrWord(7) = "挀bai" arrWord(8) = "扳ban" arrWord(9) = "邦bang" arrWord(10) = "勹bao" arrWord(11) = "陂bei" arrWord(12) = "奔ben"

excel提取汉字的拼音首字母集锦

方法二:VBA自定义函数"=hztopy()" 下面是一个VBA自定义函数,工具->宏->Visual Basic编辑器->,插入模块,在VBA编辑器里面->插入->模块->贴入下述代码,那么,比如在A3中有"进退两难",则在B3中输入"=hztopy(A3)",则会得到"JTLN"。 不过此法有时候也会出错,比如"皓、鑫、婷、雯、奕"等,就无法提取汉字拼音首字母。" Function hztopy(hzpy As String) As String Dim hzstring As String, pystring As String Dim hzpysum As Integer, hzi As Integer, hzpyhex As Integer hzstring = Trim(hzpy) hzpysum = Len(Trim(hzstring)) pystring = "" For hzi = 1 To hzpysum hzpyhex = "&H" + Hex(Asc(Mid(hzstring, hzi, 1))) Select Case hzpyhex Case &HB0A1 To &HB0C4: pystring = pystring + "A" Case &HB0C5 To &HB2C0: pystring = pystring + "B" Case &HB2C1 To &HB4ED: pystring = pystring + "C" Case &HB4EE To &HB6E9: pystring = pystring + "D" Case &HB6EA To &HB7A1: pystring = pystring + "E" Case &HB7A2 To &HB8C0: pystring = pystring + "F" Case &HB8C1 To &HB9FD: pystring = pystring + "G" Case &HB9FE To &HBBF6: pystring = pystring + "H" Case &HBBF7 To &HBFA5: pystring = pystring + "J" Case &HBFA6 To &HC0AB: pystring = pystring + "K" Case &HC0AC To &HC2E7: pystring = pystring + "L" Case &HC2E8 To &HC4C2: pystring = pystring + "M" Case &HC4C3 To &HC5B5: pystring = pystring + "N" Case &HC5B6 To &HC5BD: pystring = pystring + "O" Case &HC5BE To &HC6D9: pystring = pystring + "P" Case &HC6DA To &HC8BA: pystring = pystring + "Q" Case &HC8BB To &HC8F5: pystring = pystring + "R" Case &HC8F6 To &HCBF9: pystring = pystring + "S" Case &HCBFA To &HCDD9: pystring = pystring + "T" Case &HEDC5: pystring = pystring + "T" Case &HCDDA To &HCEF3: pystring = pystring + "W" Case &HCEF4 To &HD1B8: pystring = pystring + "X" Case &HD1B9 To &HD4D0: pystring = pystring + "Y" Case &HD4D1 To &HD7F9: pystring = pystring + "Z" Case Else pystring = pystring + Mid(hzstring, hzi, 1)

获取汉字全拼以及首字母缩拼

获取汉字全拼以及首字母缩拼 using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace https://www.sodocs.net/doc/a03141267.html,mon.Tools { /// <summary> /// 汉字转拼音静态类,包括功能全拼和缩写,方法全部是静态的/// </summary> public static class Chinese2Spell { #region 属性数据定义 /// <summary> /// 汉字的机内码数组 /// </summary> private static int[] pyValue = new int[] {

-20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20242,-202 30,-20051,-20036, -20032,-20026,-20002,-19990,-19986,-19982,-19976,-19805,-19784,-197 75,-19774,-19763, -19756,-19751,-19746,-19741,-19739,-19728,-19725,-19715,-19540,-195 31,-19525,-19515, -19500,-19484,-19479,-19467,-19289,-19288,-19281,-19275,-19270,-192 63,-19261,-19249, -19243,-19242,-19238,-19235,-19227,-19224,-19218,-19212,-19038,-190 23,-19018,-19006, -19003,-18996,-18977,-18961,-18952,-18783,-18774,-18773,-18763,-187 56,-18741,-18735, -18731,-18722,-18710,-18697,-18696,-18526,-18518,-18501,-18490,-184 78,-18463,-18448, -18447,-18446,-18239,-18237,-18231,-18220,-18211,-18201,-18184,-181 83, -18181,-18012, -17997,-17988,-17970,-17964,-17961,-17950,-17947,-17931,-17928,-179 22,-17759,-17752, -17733,-17730,-17721,-17703,-17701,-17697,-17692,-17683,-17676,-174 96,-17487,-17482, -17468,-17454,-17433,-17427,-17417,-17202,-17185,-16983,-16970,-169 42,-16915,-16733,

在excel中把汉字转换成拼音只取首字母修订版

在e x c e l中把汉字转换成拼音只取首字母修订 版 IBMT standardization office【IBMT5AB-IBMT08-IBMT2C-ZZT18】

打开Excel->工具->宏->Viaual Basic编辑器 在弹出来的窗口中对着VBAproject点右键->插入->模块下面会出现一个名为"模块1",点击 在右边的空白栏中粘贴以下内容: Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20284: pinyin = "A" Case -20283 To -19776: pinyin = "B" Case -19775 To -19219: pinyin = "C"

Case -19218 To -18711: pinyin = "D" Case -18710 To -18527: pinyin = "E" Case -18526 To -18240: pinyin = "F" Case -18239 To -17923: pinyin = "G" Case -17922 To -17418: pinyin = "H" Case -17417 To -16475: pinyin = "J" Case -16474 To -16213: pinyin = "K" Case -16212 To -15641: pinyin = "L" Case -15640 To -15166: pinyin = "M"

Case -15165 To -14923: pinyin = "N" Case -14922 To -14915: pinyin = "O" Case -14914 To -14631: pinyin = "P" Case -14630 To -14150: pinyin = "Q" Case -14149 To -14091: pinyin = "R" Case -14090 To -13319: pinyin = "S" Case -13318 To -12839: pinyin = "T" Case -12838 To -12557: pinyin = "W" Case -12556 To -11848: pinyin = "X" Case -11847 To -11056: pinyin = "Y"

oracle汉字转拼音函数

第一种方法:(首字母/全拼) create or replace type spell_code as object(spell varchar2(10),code number); create or replace type t_spellcode is table of spell_code; --返回拼音与代码的对应关系 create or replace function f_getSpellcode return t_spellcode Pipelined is Begin PIPE Row(spell_code('a', -20319)); PIPE Row(spell_code('ai', -20317)); PIPE Row(spell_code('an', -20304)); PIPE Row(spell_code('ang', -20295)); PIPE Row(spell_code('ao', -20292)); PIPE Row(spell_code('ba', -20283)); PIPE Row(spell_code('bai', -20265)); PIPE Row(spell_code('ban', -20257)); PIPE Row(spell_code('bang', -20242)); PIPE Row(spell_code('bao', -20230)); PIPE Row(spell_code('bei', -20051)); PIPE Row(spell_code('ben', -20036)); PIPE Row(spell_code('beng', -20032)); PIPE Row(spell_code('bi', -20026)); PIPE Row(spell_code('bian', -20002)); PIPE Row(spell_code('biao', -19990)); PIPE Row(spell_code('bie', -19986)); PIPE Row(spell_code('bin', -19982)); PIPE Row(spell_code('bing', -19976)); PIPE Row(spell_code('bo', -19805)); PIPE Row(spell_code('bu', -19784)); PIPE Row(spell_code('ca', -19775)); PIPE Row(spell_code('cai', -19774)); PIPE Row(spell_code('can', -19763)); PIPE Row(spell_code('cang', -19756)); PIPE Row(spell_code('cao', -19751)); PIPE Row(spell_code('ce', -19746)); PIPE Row(spell_code('ceng', -19741)); PIPE Row(spell_code('cha', -19739));

excel汉字转换成拼音简拼(只取首字母)

打开Excel->工具->宏->Viaual Basic编辑器 在弹出来的窗口中对着VBAproject点右键->插入->模块下面会出现一个名为"模块1",点击 在右边的空白栏中粘贴以下内容: Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20284: pinyin = "A" Case -20283 To -19776: pinyin = "B" Case -19775 To -19219: pinyin = "C" Case -19218 To -18711: pinyin = "D" Case -18710 To -18527: pinyin = "E" Case -18526 To -18240: pinyin = "F" Case -18239 To -17923: pinyin = "G" Case -17922 To -17418: pinyin = "H" Case -17417 To -16475: pinyin = "J" Case -16474 To -16213: pinyin = "K" Case -16212 To -15641: pinyin = "L" Case -15640 To -15166: pinyin = "M" Case -15165 To -14923: pinyin = "N" Case -14922 To -14915: pinyin = "O" Case -14914 To -14631: pinyin = "P"

汉字转化为拼音程序代码

原理,使用Dictionary技术 1.添加索引 2.遍历词典 <% Set d = CreateObject("Scripting.Dictionary") d.add "a",-20319 d.add "ai",-20317 d.add "an",-20304 d.add "ang",-20295 d.add "ao",-20292 d.add "ba",-20283 d.add "bai",-20265 d.add "ban",-20257 d.add "bang",-20242 d.add "bao",-20230 d.add "bei",-20051 d.add "ben",-20036 d.add "beng",-20032 d.add "bi",-20026 d.add "bian",-20002 d.add "biao",-19990 d.add "bie",-19986 d.add "bin",-19982 d.add "bing",-19976 d.add "bo",-19805 d.add "bu",-19784 d.add "ca",-19775 d.add "cai",-19774 d.add "can",-19763 d.add "cang",-19756 d.add "cao",-19751 d.add "ce",-19746 d.add "ceng",-19741 d.add "cha",-19739 d.add "chai",-19728 d.add "chan",-19725 d.add "chang",-19715 d.add "chao",-19540 d.add "che",-19531 d.add "chen",-19525 d.add "cheng",-19515 d.add "chi",-19500 d.add "chong",-19484

汉字取拼音首字母程序vba

Option Explicit Public Sub dnxbz() Dim myrange As Range Dim i As Long, j As Long Dim temp As String Set myrange = Worksheets("Sheet1").Range("a1").CurrentRegion For i = 1 To myrange.Rows.Count '从1行开始到有数据的最后一行 temp = Cells(i, "A") '假设原数据在A列 For j = 1 To Len(temp) If Get_Pinyin(Mid(temp, j, 1)) <> "" Then Mid(temp, j, 1) = Get_Pinyin(Mid(temp, j, 1)) '如果速度慢再加个变量 Next Cells(i, "B") = temp '假设B列为输出数据 Next End Sub Public Function Get_Pinyin(ByVal Hanzi As String) As String Dim Ch As String Ch = Left(Hanzi, 1) Select Case Asc(Ch) Case -20319 To -20284 Get_Pinyin = "A" Case -20283 To -19776 Get_Pinyin = "B" Case -19775 To -19219 Get_Pinyin = "C" Case -19218 To -18711 Get_Pinyin = "D" Case -18710 To -18527 Get_Pinyin = "E" Case -18526 To -18240 Get_Pinyin = "F" Case -18239 To -17923 Get_Pinyin = "G" Case -17922 To -17418 Get_Pinyin = "H" Case -17417 To -16475 Get_Pinyin = "J" Case -16474 To -16217 Get_Pinyin = "K"

宏 拼音转汉字

Option Explicit Option Compare Text Public Function HZQP(expression As String, Optional delimiter As String = " ", Optional limit As Integer = -1) As String 'expression ' 必需的?包含要转换的字符串? 'delimiter ' 可选的。用于标识分隔拼音的字符串字符。如果忽略,则使用空格字符(" ")作为分隔符。如果delimiter是一个长度为零的字符串,则返回仅包含一个元素,即完整的 expression字符串。 'limit ' 可选的。要返回拼音字符数,–1表示返回所有的拼音字符数,1表示返回拼音首字母。 Dim STR As String, arrWord(400) As String Dim i As Integer, j As Integer arrWord(1) = "吖a" arrWord(2) = "哎ai" arrWord(3) = "腤an" arrWord(4) = "肮ang" arrWord(5) = "凹ao" arrWord(6) = "八ba" arrWord(7) = "挀bai" arrWord(8) = "扳ban" arrWord(9) = "邦bang" arrWord(10) = "勹bao" arrWord(11) = "陂bei" arrWord(12) = "奔ben" arrWord(13) = "崩beng" arrWord(14) = "皀bi" arrWord(15) = "边bian" arrWord(16) = "杓biao" arrWord(17) = "憋bie" arrWord(18) = "邠bin" arrWord(19) = "仌bing" arrWord(20) = "拨bo" arrWord(21) = "峬bu" arrWord(22) = "嚓ca" arrWord(23) = "猜cai" arrWord(24) = "飡can" arrWord(25) = "仓cang" arrWord(26) = "撡cao" arrWord(27) = "冊ce" arrWord(28) = "嵾cen" arrWord(29) = "噌ceng" arrWord(30) = "*cha"

excel:汉字拼音首字母提取

方法一:VBA自定义函数"=hztopy()" 下面是一个VBA自定义函数,工具->宏->Visual Basic编辑器->,插入模块,在VBA编辑器里面->插入->模块->贴入下述代码,(按ALT+F11,插入模块,在右面窗口中粘贴下面代码)那么,比如在A3中有"进退两难",则在B3中输入"=hztopy(A3)",则会得到"JTLN"。 不过此法有时候也会出错,比如"皓、鑫、婷、雯、奕"等,就无法提取汉字拼音首字母。 Function hztopy(hzpy As String) As String Dim hzstring As String, pystring As String Dim hzpysum As Integer, hzi As Integer, hzpyhex As Integer hzstring = Trim(hzpy) hzpysum = Len(Trim(hzstring)) pystring = "" For hzi = 1 To hzpysum hzpyhex = "&H" + Hex(Asc(Mid(hzstring, hzi, 1))) Select Case hzpyhex Case &HB0A1 To &HB0C4: pystring = pystring + "A" Case &HB0C5 To &HB2C0: pystring = pystring + "B" Case &HB2C1 To &HB4ED: pystring = pystring + "C" Case &HB4EE To &HB6E9: pystring = pystring + "D" Case &HB6EA To &HB7A1: pystring = pystring + "E" Case &HB7A2 To &HB8C0: pystring = pystring + "F" Case &HB8C1 To &HB9FD: pystring = pystring + "G" Case &HB9FE To &HBBF6: pystring = pystring + "H" Case &HBBF7 To &HBFA5: pystring = pystring + "J" Case &HBFA6 To &HC0AB: pystring = pystring + "K" Case &HC0AC To &HC2E7: pystring = pystring + "L" Case &HC2E8 To &HC4C2: pystring = pystring + "M" Case &HC4C3 To &HC5B5: pystring = pystring + "N" Case &HC5B6 To &HC5BD: pystring = pystring + "O" Case &HC5BE To &HC6D9: pystring = pystring + "P" Case &HC6DA To &HC8BA: pystring = pystring + "Q" Case &HC8BB To &HC8F5: pystring = pystring + "R" Case &HC8F6 To &HCBF9: pystring = pystring + "S" Case &HCBFA To &HCDD9: pystring = pystring + "T" Case &HEDC5: pystring = pystring + "T" Case &HCDDA To &HCEF3: pystring = pystring + "W"

花语(按中文拼音首字母排序)

A B 百合的花语——纯洁/神圣 百合(火红)--热烈的爱 香水百合---纯洁,高贵 彼岸花的花语是——悲伤的回忆(日本)/相互思念(韩国) 白日菊--永失我爱 波斯菊的花语——永远快乐 C 雏菊——隐藏爱情 菖蒲-相信者的幸福 菖蒲(德国品种)的花语——婚姻完美 D 丁香---回忆 E F 风信子--永远的怀念 风信子(红色)的花语是——让人感动的爱 非洲菊的花语是--永远快乐 G 狗尾巴草的花语--暗恋 H 含羞草的花语--自卑 蝴蝶花---相信就是幸福 蝴蝶兰--我爱你 I J 桔梗花的花语是——真诚不变的爱 菊花(白色)---真实坦诚 菊(红色素)---我爱你 K 卡萨布兰卡的花语: [1]伟大的爱 [2]一种充满回忆的花,花语是淡泊的永恒 [3]易变的心 [4]不要放弃一个你深爱着的人 [5]死亡,一种盛开的很傲然,厌世的花 [6]一种永恒的美 [7]负担不起的爱

L 蓝色妖姬----相守是一种承诺,人世轮回中,怎样才能拥有一份温柔的情意! 蓝色妖姬双枝花语:相遇是一种宿命,心灵的交汇让我们有诉不尽的浪漫情怀。而如果是三枝蓝色妖姬,送花人表达的是另一种情愫——你是我最深的爱恋希望永远铭记我们这段美丽的爱情故事! 鳞托菊--永远的爱 龙舌兰的花语----是为爱付出一切 龙胆花的花语---喜欢看忧伤时的你 M 玫瑰(红色)---我爱你 玫瑰(白)的花语是——我足以与你相配 玫瑰(黄)--腿色的爱 玫瑰(紫)--珍惜的爱 玫瑰(蓝)---无法得到的东西 玫瑰(香槟)的花语——我只钟情你一个&爱上你是我今生最大的幸福,想你是我最甜蜜的痛苦,和你在一起是我的骄傲,没有你的我就像一只迷失了航线的船。梦幻的感觉 茉莉花——你是我的莫离幸福 密蒙花--请幸福到来 迷迭香花语----回忆不想忘记得过去,纪念 麦杆菊--永恒的记忆木棉花------珍惜眼前的幸福 N O P 蒲公英的花语——无法停留的爱 Q 蔷薇的花语——爱的思念;你的一切都很可爱蔷薇(红)的花语是——热恋 蔷薇(粉)的花语是——爱的誓言 蔷薇(白)的花语是——纯洁的爱情 蔷薇(黄)的花语是——永恒的微笑 蔷薇(深红色)的花语是——只想和你在一起蔷薇(野)的花语是——浪漫的爱情 牵牛花--爱情永固 R S

excel 汉字转换成拼音全拼&excel 汉字转换成拼音简拼(只取首字母)

Excel自定义函数方法: 1.启动Excel 2003(其它版本请仿照操作),打开相应的工作表; 2.执行“工具→宏→Visual Basic编辑器”命令(或者直接按“Alt+F11”组合键),进入Visual Basic编辑状态; 3.执行“插入→模块”命令,插入一个新模块。再双击插入的模块,进入模块代码编辑状态; 4.将代码输入其中; 5.代码输入完成后,关闭Visual Basic编辑窗口,返回Excel编辑状态; 6.自定义函数就可以用了,如:选中D2单元格,输入公式:=getpy(A2)。 有极个别的汉字不能转换,手动就可以了!很方便了。 Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20318: pinyin = "a " Case -20317 To -20305: pinyin = "ai " Case -20304 To -20296: pinyin = "an " Case -20295 To -20293: pinyin = "ang " Case -20292 To -20284: pinyin = "ao " Case -20283 To -20266: pinyin = "ba " Case -20265 To -20258: pinyin = "bai " Case -20257 To -20243: pinyin = "ban " Case -20242 To -20231: pinyin = "bang " Case -20230 To -20052: pinyin = "bao " Case -20051 To -20037: pinyin = "bei " Case -20036 To -20033: pinyin = "ben " Case -20032 To -20027: pinyin = "beng " Case -20026 To -20003: pinyin = "bi " Case -20002 To -19991: pinyin = "bian " Case -19990 To -19987: pinyin = "biao " Case -19986 To -19983: pinyin = "bie " Case -19982 To -19977: pinyin = "bin " Case -19976 To -19806: pinyin = "bing " Case -19805 To -19785: pinyin = "bo " Case -19784 To -19776: pinyin = "bu " Case -19775 To -19775: pinyin = "ca " Case -19774 To -19764: pinyin = "cai " Case -19763 To -19757: pinyin = "can " Case -19756 To -19752: pinyin = "cang " Case -19751 To -19747: pinyin = "cao " Case -19746 To -19742: pinyin = "ce " Case -19741 To -19740: pinyin = "ceng " Case -19739 To -19729: pinyin = "cha " Case -19728 To -19726: pinyin = "chai "

获取汉字的首字母

获取汉字的首字母 此文章从网上摘抄留着自己使用,现分享给大家。我在做一个搜索功能输入首字母显示对应的汉字信息。在后台录入数据时不能总是让客户把汉字的首字母给输进去。为了给客户以个好的体现,从后台自动获取汉字首字母存入数据中,当查询的时候方面使用。 public class chInitial { // 简体中文的编码范围从B0A1(45217)一直到F7FE(63486) private static int BEGIN = 45217; private static int END = 63486; // 按照声母表示,这个表是在GB2312中的出现的第一个汉字,也就是说“啊”是代表首字母a的第一个汉字。 // i, u, v都不做声母, 自定规则跟随前面的字母 private static char[] chartable = { '啊', '芭', '擦', '搭', '蛾', '发', '噶', '哈', '哈', '击', '喀', '垃', '妈', '拿', '哦', '啪', '期', '然', '撒', '塌', '塌', '塌', '挖', '昔', '压', '匝', }; // 二十六个字母区间对应二十七个端点 // GB2312码汉字区间十进制表示 private static int[] table = new int[27]; // 对应首字母区间表 private static char[] initialtable = { 'a', 'b', 'c', 'd', 'e', 'f', 'g',

'h', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 't', 't', 'w', 'x', 'y', 'z', }; // 初始化 static { for (int i = 0; i < 26; i++) { table[i] = gbValue(chartable[i]);// 得到GB2312码的首字母区间端点表,十进制。 } table[26] = END;// 区间表结尾 } // ------------------------public方法区------------------------ /** *根据一个包含汉字的字符串返回一个汉字拼音首字母的字符串最重要的一个方法,思路如下:一个个字符读入、判断、输出 */ public static String cn2py(String SourceStr) { String Result = ""; int StrLength = SourceStr.length(); int i; try { for (i = 0; i < StrLength; i++) {

个常用汉字 按照拼音首字母排序

3500个常用汉字 A 啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳 B 芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖 C 擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错 D 搭达答瘩打大呆歹傣戴带殆代贷袋待逮怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕 E 蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二贰 F 发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐 G 噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨

Excel中将汉字转化为拼音

Excel中将汉字转化为拼音(完整拼音)版 1.打开Excel->工具->宏->Viaual Basic编辑器 2.在弹出来的窗口中对着VBAproject点右键->插入->模块 3.下面会出现一个名为"模块1",点击 4.在右边的空白栏中粘贴以下内容: Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20318: pinyin = "a " Case -20317 To -20305: pinyin = "ai " Case -20304 To -20296: pinyin = "an " Case -20295 To -20293: pinyin = "ang " Case -20292 To -20284: pinyin = "ao " Case -20283 To -20266: pinyin = "ba " Case -20265 To -20258: pinyin = "bai " Case -20257 To -20243: pinyin = "ban " Case -20242 To -20231: pinyin = "bang " Case -20230 To -20052: pinyin = "bao " Case -20051 To -20037: pinyin = "bei " Case -20036 To -20033: pinyin = "ben " Case -20032 To -20027: pinyin = "beng " Case -20026 To -20003: pinyin = "bi " Case -20002 To -19991: pinyin = "bian " Case -19990 To -19987: pinyin = "biao " Case -19986 To -19983: pinyin = "bie " Case -19982 To -19977: pinyin = "bin " Case -19976 To -19806: pinyin = "bing " Case -19805 To -19785: pinyin = "bo " Case -19784 To -19776: pinyin = "bu " Case -19775 To -19775: pinyin = "ca " Case -19774 To -19764: pinyin = "cai " Case -19763 To -19757: pinyin = "can " Case -19756 To -19752: pinyin = "cang " Case -19751 To -19747: pinyin = "cao " Case -19746 To -19742: pinyin = "ce " Case -19741 To -19740: pinyin = "ceng " Case -19739 To -19729: pinyin = "cha " Case -19728 To -19726: pinyin = "chai " Case -19725 To -19716: pinyin = "chan " Case -19715 To -19541: pinyin = "chang " Case -19540 To -19532: pinyin = "chao " Case -19531 To -19526: pinyin = "che "

相关主题