function CString_Class() {
  this.slice = function (str, start, end) {
    return str.slice(start, end || str.length)
  }
  this.substr = function (str, start, end) {
    return str.substr(start, end || str.length)
  }
  this.getmid = function (str, lstr, rstr, start, mode) {
    // '1 不区分大小写
    // '2 先查右再左
    // '4 后往前查
    mode = mode || 0;
    start = (mode & 4 && !start) ? mstr.length : start || 0;
    if (start < 0) start = start + mstr.length + 1;
    if (mode & 1) {
      var mlstr = lstr.toLowerCase();
      var mrstr = rstr.toLowerCase();
      var mstr = str.toLowerCase();
    } else {
      var mstr = str;
      var mlstr = lstr;
      var mrstr = rstr;
    }
    if (mode & 2) {
      var r = mode & 4 ? mstr.lastIndexOf(mrstr, start) : mstr.indexOf(mrstr, start);
      if (r == -1) return;
      var l = mstr.lastIndexOf(mlstr, r - 1);
      if (l == -1) return;
      l += mlstr.length
    } else {
      var l = mode & 4 ? mstr.lastIndexOf(mlstr, start) : mstr.indexOf(mlstr, start);
      if (l == -1) return;
      l += mlstr.length
      var r = mstr.indexOf(mrstr, l);
      if (r == -1) return;
    }
    return str.slice(l, r)
  }
  this.fromUnicode = function (str) {
    return eval("'" + str + "'");
  }
  this.toUnicode = function (str) {
    return escape(str).replace(/%/g, "\\")
  }
  this.urlencode = function (str, format) {
    return format ? encodeURIComponent(str) : encodeURI(str);//  ,/?:@&=+$#"
  }
  this.urldecode = function (str, format) {
    return format ? decodeURIComponent(str) : decodeURI(str);; //  -_.!~*'() //  ,/?:@&=+$#"
  }
}