function strLen(str){ var len=0; for(var i=0;i<str.length;i++){ var intCode=str.charCodeAt(i); if(intCode>=0 && intCode<=128){ len = len + 1; }else{ len = len + 2; } } return len; }
Private Function Length(iTxt) Dim txt: txt = Trim(iTxt) Dim x: x = Len(txt) Dim y: y = 0 Dim ii, chrA For ii = 1 To x chrA = Mid(txt, ii, 1) If Asc(chrA) >= 0 And Asc(chrA) <= 255 Then y = y + 1 Else y = y + 2 End If Next Length = y End Function
阅读:219
评论:0
゛. - 看過世间最冷漠滴眼神, 爱過⒈生最无缘滴人﹎
该页面还没有任何评论,赶快占个沙发吧!