网站首页 网站建设 IT知识 IT知识教程 ASP常用函数:getpy()

ASP常用函数:getpy()

2021-05-28 10:02:36
<%
'取字段数据每个汉字的拼音首字母

Functiongetpychar(char)
tmp=65536+Asc(char)
If(tmp>=45217Andtmp<=45252)Then
getpychar="A"
ElseIf(tmp>=45253Andtmp<=45760)Then
getpychar="B"
ElseIf(tmp>=47761Andtmp<=46317)Then
getpychar="C"
ElseIf(tmp>=46318Andtmp<=46825)Then
getpychar="D"
ElseIf(tmp>=46826Andtmp<=47009)Then
getpychar="E"
ElseIf(tmp>=47010Andtmp<=47296)Then
getpychar="F"
ElseIf(tmp>=47297Andtmp<=47613)Then
getpychar="G"
ElseIf(tmp>=47614Andtmp<=48118)Then
getpychar="H"
ElseIf(tmp>=48119Andtmp<=49061)Then
getpychar="J"
ElseIf(tmp>=49062Andtmp<=49323)Then
getpychar="K"
ElseIf(tmp>=49324Andtmp<=49895)Then
getpychar="L"
ElseIf(tmp>=49896Andtmp<=50370)Then
getpychar="M"
ElseIf(tmp>=50371Andtmp<=50613)Then
getpychar="N"
ElseIf(tmp>=50614Andtmp<=50621)Then
getpychar="O"
ElseIf(tmp>=50622Andtmp<=50905)Then
getpychar="P"
ElseIf(tmp>=50906Andtmp<=51386)Then
getpychar="Q"
ElseIf(tmp>=51387Andtmp<=51445)Then
getpychar="R"
ElseIf(tmp>=51446Andtmp<=52217)Then
getpychar="S"
ElseIf(tmp>=52218Andtmp<=52697)Then
getpychar="T"
ElseIf(tmp>=52698Andtmp<=52979)Then
getpychar="W"
ElseIf(tmp>=52980Andtmp<=53640)Then
getpychar="X"
ElseIf(tmp>=53689Andtmp<=54480)Then
getpychar="Y"
ElseIf(tmp>=54481Andtmp<=62289)Then
getpychar="Z"
Else'如果不是中文,则不处理
getpychar=char
EndIf
EndFunction

Functiongetpy(Str)
Fori=1ToLen(Str)
getpy=getpy&getpychar(Mid(Str,i,1))
Next
EndFunction
%>

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。 如涉及版权问题,请提交至online#300.cn邮箱联系删除。

以上产品还未完全满足我的所有需求,在下方提交我的专属需求
我的专属需求:
*手机号:
*验证码:
img
咨询报价
现在咨询
img

在线咨询

建站在线咨询

img

微信咨询

扫一扫添加
动力姐姐微信

img
img

TOP