The ASP obtains the Chinese sentence first word capital Pinyin function _ Application Skill
Source: Internet
Author: User
Get the capital pinyin of the first word in Chinese sentence
<%
'******************************
' Function: Getpychar (char)
' parameter: Char, any Chinese character or sentence
' Author: Arisisi
' Date: 2007/7/15
' Description: Get a capital pinyin of the first word in Chinese sentence
' Example: Getpychar ("Welcome to Arisisi")
'******************************
Function Getpychar (char)
Dim tmp
TMP=65536+ASC (char)
If (tmp>=45217 and tmp<=45252) Then
Getpychar= "A"
ElseIF (tmp>=45253 and tmp<=45760) Then
Getpychar= "B"
ElseIF (tmp>=45761 and tmp<=46317) Then
Getpychar= "C"
ElseIF (tmp>=46318 and tmp<=46825) Then
Getpychar= "D"
ElseIF (tmp>=46826 and tmp<=47009) Then
Getpychar= "E"
ElseIF (tmp>=47010 and tmp<=47296) Then
Getpychar= "F"
ElseIF (tmp>=47297 and tmp<=47613) Then
Getpychar= "G"
ElseIF (tmp>=47614 and tmp<=48118) Then
Getpychar= "H"
ElseIF (tmp>=48119 and tmp<=49061) Then
Getpychar= "J"
ElseIF (tmp>=49062 and tmp<=49323) Then
Getpychar= "K"
ElseIF (tmp>=49324 and tmp<=49895) Then
Getpychar= "L"
ElseIF (tmp>=49896 and tmp<=50370) Then
Getpychar= "M"
ElseIF (tmp>=50371 and tmp<=50613) Then
Getpychar= "N"
ElseIF (tmp>=50614 and tmp<=50621) Then
Getpychar= "O"
ElseIF (tmp>=50622 and tmp<=50905) Then
Getpychar= "P"
ElseIF (tmp>=50906 and tmp<=51386) Then
Getpychar= "Q"
ElseIF (tmp>=51387 and tmp<=51445) Then
Getpychar= "R"
ElseIF (tmp>=51446 and tmp<=52217) Then
Getpychar= "S"
ElseIF (tmp>=52218 and tmp<=52697) Then
Getpychar= "T"
ElseIF (tmp>=52698 and tmp<=52979) Then
Getpychar= "W"
ElseIF (tmp>=52980 and tmp<=53640) Then
Getpychar= "X"
ElseIF (tmp>=53689 and tmp<=54480) Then
Getpychar= "Y"
ElseIF (tmp>=54481 and tmp<=62289) Then
Getpychar= "Z"
Else ' If it is not Chinese, it is not processed
Getpychar=char
End If
End Function
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.