If Exists (Select name From sysobjects
Where name = 'HZToPY' And type = 'FN')
Drop Function HZToPY
GO
Create Function HZToPY(@HZ VarChar(50))
Returns VarChar(50)
As
Begin
Declare @PY VarChar(50),@LenHZ int,@i int,@FristWord VarChar(2)
Set @LenHZ = Len(@HZ)
Set @i = 1
Set @PY = ''
While @i <= @LenHZ
Begin
Set @FristWord = SubString(@HZ,@i,1)
If( @FristWord < '八' )
Begin
If (@FristWord >= '0' And @FristWord <= '9') Set @PY = @PY + @FristWord
Else If (@FristWord >= 'A' And @FristWord <= 'Z') Set @PY = @PY + @FristWord
Else Set @PY = @PY + ''
End
Else If( @FristWord < '嚓' ) Set @PY = @PY + 'B'
Else If( @FristWord < '咑' ) Set @PY = @PY + 'C'
Else If( @FristWord < '妸' ) Set @PY = @PY + 'D'
Else If( @FristWord < '发' ) Set @PY = @PY + 'E'
Else If( @FristWord < '旮' ) Set @PY = @PY + 'F'
Else If( @FristWord < '铪' ) Set @PY = @PY + 'G'
Else If( @FristWord < '讥' ) Set @PY = @PY + 'H'
Else If( @FristWord < '咔' ) Set @PY = @PY + 'J'
Else If( @FristWord < '垃' ) Set @PY = @PY + 'K'
Else If( @FristWord < '嘸' ) Set @PY = @PY + 'L'
Else If( @FristWord < '拏' ) Set @PY = @PY + 'M'
Else If( @FristWord < '噢' ) Set @PY = @PY + 'N'
Else If( @FristWord < '妑' ) Set @PY = @PY + 'O'
Else If( @FristWord < '七' ) Set @PY = @PY + 'P'
Else If( @FristWord < '亽' ) Set @PY = @PY + 'Q'
Else If( @FristWord < '仨' ) Set @PY = @PY + 'R'
Else If( @FristWord < '他' ) Set @PY = @PY + 'S'
Else If( @FristWord < '哇' ) Set @PY = @PY + 'T'
Else If( @FristWord < '夕' ) Set @PY = @PY + 'W'
Else If( @FristWord < '丫' ) Set @PY = @PY + 'X'
Else If( @FristWord < '帀' ) Set @PY = @PY + 'Y'
Else If( @FristWord < '咗' ) Set @PY = @PY + 'Z'
Else Set @PY = @PY + ''
Set @i = @i + 1
End
Return (@PY)
End
Go
分享到:
相关推荐
简介:自己写的IDEA插件,可以将汉字转换为拼音缩写的插件,有需要的可以下载玩玩。 用法:下载之后正常进行插件安装,安装之后在Edit菜单里面会出现ChineseToPY选项,选中文字之后点击这个选项就可以将所选的文字...
支持汉字转换拼音,汉字转换拼音缩写。其实程序没有什么,重点在于已经统计了大部分常用汉字
用ASP.net写的,很实用的中文转拼音缩写示例,支持字符串和字符混合。
输入汉字系统自动识别汉语拼音首字母缩写
主要为大家详细介绍了C#实现汉字转换为拼音缩写的代码,感兴趣的小伙伴们可以参考一下
根据汉字查看首字母拼音缩写;汉字转拼音。
一个很强大的汉字转拼音缩写.......................
中文转换成拼音简称和全称,并且附上全部原代码,仅供学习参考使用。
网上找到的代码,我觉得有用
汉字转成拼音,分两个文件,一个是简写的,一个是全拼的
asp.net汉字转拼音缩写.rar
主要介绍了JavaScript实现汉字转换为拼音及缩写的方法,结合实例形式分析了javascript数组遍历、转换实现汉字转拼音相关操作技巧,需要的朋友可以参考下
Java汉字转换为拼音工具类 汉字转换为拼音包括全拼、首字母缩写;全拼可计算出多音字。
一个可以吧汉字转拼音的C#代码,小模块大家可以试试看.
使用VBA编写的中文转拼音的excel表格,推荐大家使用。
.net把汉字转换成拼音首字母缩写 很实用,无需加其他的直接调用即可
使用C++ Qt实现的汉字转拼音或拼音简写项目源码
此JavaScript可以将输入的中文汉字转成拼音全拼或首字母缩写,比如说输入一个“你好”,调用getFullChars()方法对应输出拼音“NiHao”或者调用getCamelChars可以选择输出“NH”。压缩包内包含转换javaScript插件...
C# 汉字转拼音缩写源码,用于联想输入匹配。
文件自带两个宏,拼音简写和拼音。已添加部分不在库的汉字