zoukankan      html  css  js  c++  java
  • js 解析 bytearray 成 字符串

    function bin2String(array) {
      return String.fromCharCode.apply(String, array);
    }
    
    var bit=[104,101,108,108,111,32,119,111,114,108,100];
    
    var tostring=bin2String(['104','101','108','108','111','32','119','111','114','108','100']); // "hello word"
        console.log(tostring);

    二进制转换为字符串

    参考 http://stackoverflow.com/questions/3195865/converting-byte-array-to-string-in-javascript

  • 相关阅读:
    内部类
    this关键字
    封装
    构造方法
    类图
    StringBuffer
    String
    导包
    包名规范
    带参数的方法
  • 原文地址:https://www.cnblogs.com/freefei/p/4021733.html
Copyright © 2011-2022 走看看