instrb     indexOf
midb       substr
lenb没有

解决方案 »

  1.   

    没有,需要自己写。
    例:
    /*** 返回字节数 ***/
    String.prototype.lenb = function() {
      return this.replace(/[^\x00-\xff]/g,"**").length;
    }
      

  2.   

    1.InStrB在jscript中为indexof
    function IndexDemo(str2){
       var str1 = "BABEBIBOBUBABEBIBOBU"
       var s = str1.indexOf(str2);
       return(s);
    }
    2 LenB在jscript中为length 属性包含一个整数,用来指出 String 对象中的字符数。String 对象中的最后一个字符的索引为 length - 1。3 midB用jscript中substr就可解决
    function SubstrDemo(){
       var s, ss;                // 声明变量。
       var s = "The rain in Spain falls mainly in the plain.";
       ss = s.substr(12, 5);  // 获取子字符串。
       return(ss);               // 返回 "Spain"。
    }
      

  3.   

    在JAVASCRIPT中的字符串是UNICODE呀,,是双字节的字符串。。在VBSCRIPT中的字符串也是UNICODE的,有类似的函数InStr,,Mid,,Len等函数。。而操作ANSI
    ,,单字节字符串,,有类似的函数InStrB,,LenB等等。。谢谢大家的回复,,请大家帮我呀,,关于这方面,,一直搞不明白。
      

  4.   

    /*** 返回字节数 ***/
    String.prototype.lenb = function() {
      return this.replace(/[^\x00-\xff]/g,"**").length;
    }谢谢,,,有点明白,,能不能详细说一下呀。。