Javascript String bytes()

Description

Javascript String bytes()


String.prototype.bytes = function() {
  var arr = this.match( /[^\x00-\xff]/ig );
  return  arr === null ? this.length : this.length + arr.length;
};



PreviousNext

Related