2013/2/6 17:33:061851 閱讀
function length(input) dim c,e c=ubound(split(escape(input),"%u")) e=len(input)-c length ="漢字:" & c & "個,英文" & e & "個" end function '測試結果 dim str : str = "判斷一串字符串中,有多少個english,多少個中文?" '測試執(zhí)行1萬次時間 dim t1,t2 t1=timer() for i=1 to 10000 response.write length(str) & "" next t2=timer() response.write "執(zhí)行1萬次需要:" & (t2-t1 )*1000 & "毫秒" '執(zhí)行1萬次需要:171.875毫秒
微信小程序
掃描手機瀏覽