'獲取客戶簡稱的拼音縮寫
function getpy()
dim str
dim i
str=document.all.txtcontactname.value
dim ret
for i=1 to len(str)
ret=ret&getpychar(mid(str,i,1))
next
document.all.txtspellcode.value=ret
end function
getpychar=char
end if
end function
spellcode.vbs
'獲取漢字拼音第一字母
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 <=53688) then
getpychar= "x"
elseif(tmp> =53689 and tmp <=54480) then
getpychar= "y"
elseif(tmp> =54481 and tmp <=62289) then
getpychar= "z"
else '如果不是中文,則不處理
getpychar=char
end if
end function
php 漢字第乙個字母排序
namespace utfmode use pinyin src pinyin class utfmode fchar ord str if fchar ord a fchar ord z return strtoupper str s1 iconv utf 8 gb2312 str s2 icon...
js獲取選中文字的第乙個字及最後乙個字的偏移量
兩種方法 方法一 mousedown時獲取偏移量,mouseup時獲取便宜量就是第乙個字及最後乙個字的座標。方法二 對選中的字畫矩形。第乙個矩形的座標就是第乙個字的座標,最後乙個字的座標是x width,y。針對方法二給出如下 在mouseup方法中 var pagediv document.get...
Oracle查詢某個欄位的第乙個字為漢字的查詢方法
ascii 字元表 ascii碼大致可以分作三部分組成。第一部分由 00h 到 1fh 共 32 個,一般用來通訊或作為控制之用,有些字元可顯示於螢幕,有些則無法顯示在螢幕上,但能看到其效果 例如換行字元 歸位字元 第二部分是由 20h 到 7fh 共 96 個,這 95 個字元是用來表示阿拉伯數字...