asp 取得中文句子头一个字的大写拼音字母的函数
2018-09-05 23:51
  取得中文句子头一个字的大写拼音字母
<% 
****************************** 
函数:getpychar(char) 
参数:char,任意中文字符或句子 
作者:阿里西西 
日期:2007/7/15 
描述:取得中文句子头一个字的大写拼音字母 
示例:getpychar(欢迎访问阿里西西) 
****************************** 
Functiongetpychar(char) 
Dimtmp 
tmp=65536+Asc(char) 
If(tmp>=45217Andtmp<=45252)Then 
getpychar=A 
ElseIF(tmp>=45253Andtmp<=45760)Then 
getpychar=B 
ElseIF(tmp>=45761Andtmp<=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 
%>
文章标题:asp 取得中文句子头一个字的大写拼音字母的函数
文章链接:http://soscw.com/index.php/essay/8521.html