ASP常用函数:getpy()_ASP教程-查字典教程网
ASP常用函数:getpy()
ASP常用函数:getpy()
发布时间:2016-12-29 来源:查字典编辑
摘要:

<%

'取字段数据每个汉字的拼音首字母

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

%>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类