新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > Web开发 > Asp教程 > 正文:用字典提取汉语的拼音的首字母

用字典提取汉语的拼音的首字母

新客网 XKER.COM 2004-05-15 来源: 收藏本文
<%
function getpychar(char)
tmp=65536+asc(char)
if(tmp>=45217 and tmp<=45252) or left(char,1)="a" or left(char,1)="A" then getpychar= "A"
if(tmp>=45253 and tmp<=45760) or left(char,1)="b" or left(char,1)="B" then getpychar= "B"
if(tmp>=45761 and tmp<=46317) or left(char,1)="c" or left(char,1)="C" then getpychar= "C"
if(tmp>=46318 and tmp<=46825) or left(char,1)="d" or left(char,1)="D" then getpychar= "D"
if(tmp>=46826 and tmp<=47009) or left(char,1)="e" or left(char,1)="E" then getpychar= "E"
if(tmp>=47010 and tmp<=47296) or left(char,1)="f" or left(char,1)="F" then getpychar= "F"
if(tmp>=47297 and tmp<=47613) or left(char,1)="g" or left(char,1)="G" then getpychar= "G"
if(tmp>=47614 and tmp<=48118) or left(char,1)="h" or left(char,1)="H" then getpychar= "H"
if left(char,1)="I" or left(char,1)="i" then getpychar= "I"
if(tmp>=48119 and tmp<=49061) or left(char,1)="j" or left(char,1)="J" then getpychar= "J"
if(tmp>=49062 and tmp<=49323) or left(char,1)="k" or left(char,1)="K" then getpychar= "K"
if(tmp>=49324 and tmp<=49895) or left(char,1)="l" or left(char,1)="L" then getpychar= "L"
if(tmp>=49896 and tmp<=50370) or left(char,1)="m" or left(char,1)="M" then getpychar= "M"
if(tmp>=50371 and tmp<=50613) or left(char,1)="n" or left(char,1)="N" then getpychar= "N"
if(tmp>=50614 and tmp<=50621) or left(char,1)="o" or left(char,1)="O" then getpychar= "O"
if(tmp>=50622 and tmp<=50905) or left(char,1)="p" or left(char,1)="P" then getpychar= "P"
if(tmp>=50906 and tmp<=51386) or left(char,1)="q" or left(char,1)="Q" then getpychar= "Q"
if(tmp>=51387 and tmp<=51445) or left(char,1)="r" or left(char,1)="R" then getpychar= "R"
if(tmp>=51446 and tmp<=52217) or left(char,1)="s" or left(char,1)="S" then getpychar= "S"
if(tmp>=52218 and tmp<=52697) or left(char,1)="t" or left(char,1)="T" then getpychar= "T"
if left(char,1)="u" or left(char,1)="U" then getpychar= "U"
if left(char,1)="V" or left(char,1)="v" then getpychar= "V"
if(tmp>=52698 and tmp<=52979) or left(char,1)="w" or left(char,1)="W" then getpychar= "W"
if(tmp>=52980 and tmp<=53640) or left(char,1)="x" or left(char,1)="X" then getpychar= "X"
if(tmp>=53689 and tmp<=54480) or left(char,1)="y" or left(char,1)="Y" then getpychar= "Y"
if(tmp>=54481 and tmp<=55289) or left(char,1)="z" or left(char,1)="Z" then getpychar= "Z"
end function

function getpy(str)
for i=1 to len(str)
getpy=getpy&getpychar(mid(str,i,1))
next
end function
%>
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐