木子屋 Dnawo's BLOG

ASP中获取汉字拼音的第一个字母

👤 dnawo 📅 2006-06-28 👁 6320 👍 0 💬 0 🔄 来源:网络
<%
'获取汉字拼音第一字母
Function getPY(char)
dim tmp
tmp=65536+asc(char)
If (tmp >= 45217 and tmp <= 45252) Then
getPY = "A"
ElseIf (tmp >= 45253 and tmp <= 45760) Then
getPY = "B"
ElseIf (tmp >= 45761 and tmp <= 46317) Then
getPY = "C"
ElseIf (tmp >= 46318 and tmp <= 46825) Then
getPY = "D"
ElseIf (tmp >= 46826 and tmp <= 47009) Then
getPY = "E"
ElseIf (tmp >= 47010 and tmp <= 47296) Then
getPY = "F"
ElseIf (tmp >= 47297 and tmp <= 47613) Then
getPY = "G"
ElseIf (tmp >= 47614 and tmp <= 48118) Then
getPY = "H"
ElseIf (tmp >= 48119 and tmp <= 49061) Then
getPY = "J"
ElseIf (tmp >= 49062 and tmp <= 49323) Then
getPY = "K"
ElseIf (tmp >= 49324 and tmp <= 49895) Then
getPY = "L"
ElseIf (tmp >= 49896 and tmp <= 50370) Then
getPY = "M"
ElseIf (tmp >= 50371 and tmp <= 50613) Then
getPY = "N"
ElseIf (tmp >= 50614 and tmp <= 50621) Then
getPY = "O"
ElseIf (tmp >= 50622 and tmp <= 50905) Then
getPY = "P"
ElseIf (tmp >= 50906 and tmp <= 51386) Then
getPY = "Q"
ElseIf (tmp >= 51387 and tmp <= 51445) Then
getPY = "R"
ElseIf (tmp >= 51446 and tmp <= 52217) Then
getPY = "S"
ElseIf (tmp >= 52218 and tmp <= 52697) Then
getPY = "T"
ElseIf (tmp >= 52698 and tmp <= 52979) Then
getPY = "W"
ElseIf (tmp >= 52980 and tmp <= 53688) Then
getPY = "X"
ElseIf (tmp >= 53689 and tmp <= 54480) Then
getPY = "Y"
ElseIf (tmp >= 54481 and tmp <= 62289) Then
getPY = "Z"
Else
getPY = ""
End If
End function
%>

评论(0)

暂无评论。

验证码
评论需审核通过后显示
← 上一篇 如何编写一个ASP类 下一篇 → Html标签带来的安全隐患