<%
'******************************
'函数:getpychar(char)
'参数:char,任意中文字符或句子
'作者:阿里西西
'日期:2007/7/15
'描述:取得中文句子头一个字的大写拼音字母
'示例:getpychar("欢迎访问阿里西西")
'******************************
Function getpychar(char)
Dim tmp
tmp=+Asc(char) If(tmp>= And tmp<=) Then
getpychar= "A"
ElseIF(tmp>= And tmp<=) Then
getpychar= "B"
ElseIF(tmp>= And tmp<=) Then
getpychar= "C"
ElseIF(tmp>= And tmp<=) Then
getpychar= "D"
ElseIF(tmp>= And tmp<=) Then
getpychar= "E"
ElseIF(tmp>= And tmp<=) Then
getpychar= "F"
ElseIF(tmp>= And tmp<=) Then
getpychar= "G"
ElseIF(tmp>= And tmp<=) Then
getpychar= "H"
ElseIF(tmp>= And tmp<=) Then
getpychar= "J"
ElseIF(tmp>= And tmp<=) Then
getpychar= "K"
ElseIF(tmp>= And tmp<=) Then
getpychar= "L"
ElseIF(tmp>= And tmp<=) Then
getpychar= "M"
ElseIF(tmp>= And tmp<=) Then
getpychar= "N"
ElseIF(tmp>= And tmp<=) Then
getpychar= "O"
ElseIF(tmp>= And tmp<=) Then
getpychar= "P"
ElseIF(tmp>= And tmp<=) Then
getpychar= "Q"
ElseIF(tmp>= And tmp<=) Then
getpychar= "R"
ElseIF(tmp>= And tmp<=) Then
getpychar= "S"
ElseIF(tmp>= And tmp<=) Then
getpychar= "T"
ElseIF(tmp>= And tmp<=) Then
getpychar= "W"
ElseIF(tmp>= And tmp<=) Then
getpychar= "X"
ElseIF(tmp>= And tmp<=) Then
getpychar= "Y"
ElseIF(tmp>= And tmp<=) Then
getpychar= "Z"
Else '如果不是中文,则不处理
getpychar= char
End If End Function dim strname,strZi
strname = "奥斯特洛夫斯基" dim i
for i= to len(strname)
strZi = Mid(strname, i, )
response.write(getpychar(strZi))
next
response.write("<br/>"+strname) %>
方便录入数据时的自动完成。