用LS取出汉字的拼音字母
'/功能: 取出汉字的拼音字母
'/Author:博弈_猪哥哥
'/Author:博弈_猪哥哥
Function getchar(s_str As String,matchcase As Integer) As String
Dim tmp As Long
Dim per_char As String
getchar=""
s_str=Trim(s_str)
For i=1 To Len(s_str)
per_char=Mid(s_str,i,1)
n=Asc(per_char)
If n<255 Then
getchar=getchar + per_char
Else
tmp=Asc(per_char)
If matchcase=1 Then
If(tmp>=45217 And tmp<=45252) Then getchar= getchar + "A"
If(tmp>=45253 And tmp<=45760) Then getchar= getchar + "B"
If(tmp>=45761 And tmp<=46317) Then getchar= getchar + "C"
If(tmp>=46318 And tmp<=46825) Then getchar= getchar + "D"
If(tmp>=46826 And tmp<=47009) Then getchar= getchar + "E"
If(tmp>=47010 And tmp<=47296) Then getchar= getchar + "F"
If(tmp>=47297 And tmp<=47613) Then getchar= getchar + "G"
If(tmp>=47614 And tmp<=48118) Then getchar= getchar + "H"
If(tmp>=48119 And tmp<=49061) Then getchar= getchar + "J"
If(tmp>=49062 And tmp<=49323) Then getchar= getchar + "K"
If(tmp>=49324 And tmp<=49895) Then getchar= getchar + "L"
If(tmp>=49896 And tmp<=50370) Then getchar= getchar + "M"
If(tmp>=50371 And tmp<=50613) Then getchar= getchar + "N"
If(tmp>=50614 And tmp<=50621) Then getchar= getchar + "O"
If(tmp>=50622 And tmp<=50905) Then getchar= getchar + "P"
If(tmp>=50906 And tmp<=51386) Then getchar= getchar + "Q"
If(tmp>=51387 And tmp<=51445) Then getchar= getchar + "R"
If(tmp>=51446 And tmp<=52217) Then getchar= getchar + "S"
If(tmp>=52218 And tmp<=52697) Then getchar= getchar + "T"
If(tmp>=52698 And tmp<=52979) Then getchar= getchar + "W"
If(tmp>=52980 And tmp<=53640) Then getchar= getchar + "X"
If(tmp>=53689 And tmp<=54480) Then getchar= getchar + "Y"
If(tmp>=54481 And tmp<=62289) Then getchar= getchar + "Z"
Else
If(tmp>=45217 And tmp<=45252) Then getchar= getchar + "a"
If(tmp>=45253 And tmp<=45760) Then getchar= getchar + "b"
If(tmp>=45761 And tmp<=46317) Then getchar= getchar + "c"
If(tmp>=46318 And tmp<=46825) Then getchar= getchar + "d"
If(tmp>=46826 And tmp<=47009) Then getchar= getchar + "e"
If(tmp>=47010 And tmp<=47296) Then getchar= getchar + "f"
If(tmp>=47297 And tmp<=47613) Then getchar= getchar + "g"
If(tmp>=47614 And tmp<=48118) Then getchar= getchar + "h"
If(tmp>=48119 And tmp<=49061) Then getchar= getchar + "j"
If(tmp>=49062 And tmp<=49323) Then getchar= getchar + "k"
If(tmp>=49324 And tmp<=49895) Then getchar= getchar + "l"
If(tmp>=49896 And tmp<=50370) Then getchar= getchar + "m"
If(tmp>=50371 And tmp<=50613) Then getchar= getchar + "n"
If(tmp>=50614 And tmp<=50621) Then getchar= getchar + "o"
If(tmp>=50622 And tmp<=50905) Then getchar= getchar + "p"
If(tmp>=50906 And tmp<=51386) Then getchar= getchar + "q"
If(tmp>=51387 And tmp<=51445) Then getchar= getchar + "r"
If(tmp>=51446 And tmp<=52217) Then getchar= getchar + "s"
If(tmp>=52218 And tmp<=52697) Then getchar= getchar + "t"
If(tmp>=52698 And tmp<=52979) Then getchar= getchar + "w"
If(tmp>=52980 And tmp<=53640) Then getchar= getchar + "x"
If(tmp>=53689 And tmp<=54480) Then getchar= getchar + "y"
If(tmp>=54481 And tmp<=62289) Then getchar= getchar + "z"
End If
End If
Next
End Function
Dim tmp As Long
Dim per_char As String
getchar=""
s_str=Trim(s_str)
For i=1 To Len(s_str)
per_char=Mid(s_str,i,1)
n=Asc(per_char)
If n<255 Then
getchar=getchar + per_char
Else
tmp=Asc(per_char)
If matchcase=1 Then
If(tmp>=45217 And tmp<=45252) Then getchar= getchar + "A"
If(tmp>=45253 And tmp<=45760) Then getchar= getchar + "B"
If(tmp>=45761 And tmp<=46317) Then getchar= getchar + "C"
If(tmp>=46318 And tmp<=46825) Then getchar= getchar + "D"
If(tmp>=46826 And tmp<=47009) Then getchar= getchar + "E"
If(tmp>=47010 And tmp<=47296) Then getchar= getchar + "F"
If(tmp>=47297 And tmp<=47613) Then getchar= getchar + "G"
If(tmp>=47614 And tmp<=48118) Then getchar= getchar + "H"
If(tmp>=48119 And tmp<=49061) Then getchar= getchar + "J"
If(tmp>=49062 And tmp<=49323) Then getchar= getchar + "K"
If(tmp>=49324 And tmp<=49895) Then getchar= getchar + "L"
If(tmp>=49896 And tmp<=50370) Then getchar= getchar + "M"
If(tmp>=50371 And tmp<=50613) Then getchar= getchar + "N"
If(tmp>=50614 And tmp<=50621) Then getchar= getchar + "O"
If(tmp>=50622 And tmp<=50905) Then getchar= getchar + "P"
If(tmp>=50906 And tmp<=51386) Then getchar= getchar + "Q"
If(tmp>=51387 And tmp<=51445) Then getchar= getchar + "R"
If(tmp>=51446 And tmp<=52217) Then getchar= getchar + "S"
If(tmp>=52218 And tmp<=52697) Then getchar= getchar + "T"
If(tmp>=52698 And tmp<=52979) Then getchar= getchar + "W"
If(tmp>=52980 And tmp<=53640) Then getchar= getchar + "X"
If(tmp>=53689 And tmp<=54480) Then getchar= getchar + "Y"
If(tmp>=54481 And tmp<=62289) Then getchar= getchar + "Z"
Else
If(tmp>=45217 And tmp<=45252) Then getchar= getchar + "a"
If(tmp>=45253 And tmp<=45760) Then getchar= getchar + "b"
If(tmp>=45761 And tmp<=46317) Then getchar= getchar + "c"
If(tmp>=46318 And tmp<=46825) Then getchar= getchar + "d"
If(tmp>=46826 And tmp<=47009) Then getchar= getchar + "e"
If(tmp>=47010 And tmp<=47296) Then getchar= getchar + "f"
If(tmp>=47297 And tmp<=47613) Then getchar= getchar + "g"
If(tmp>=47614 And tmp<=48118) Then getchar= getchar + "h"
If(tmp>=48119 And tmp<=49061) Then getchar= getchar + "j"
If(tmp>=49062 And tmp<=49323) Then getchar= getchar + "k"
If(tmp>=49324 And tmp<=49895) Then getchar= getchar + "l"
If(tmp>=49896 And tmp<=50370) Then getchar= getchar + "m"
If(tmp>=50371 And tmp<=50613) Then getchar= getchar + "n"
If(tmp>=50614 And tmp<=50621) Then getchar= getchar + "o"
If(tmp>=50622 And tmp<=50905) Then getchar= getchar + "p"
If(tmp>=50906 And tmp<=51386) Then getchar= getchar + "q"
If(tmp>=51387 And tmp<=51445) Then getchar= getchar + "r"
If(tmp>=51446 And tmp<=52217) Then getchar= getchar + "s"
If(tmp>=52218 And tmp<=52697) Then getchar= getchar + "t"
If(tmp>=52698 And tmp<=52979) Then getchar= getchar + "w"
If(tmp>=52980 And tmp<=53640) Then getchar= getchar + "x"
If(tmp>=53689 And tmp<=54480) Then getchar= getchar + "y"
If(tmp>=54481 And tmp<=62289) Then getchar= getchar + "z"
End If
End If
Next
End Function
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22885108/viewspace-621997/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22885108/viewspace-621997/