javascript中char解码为string

/**
* 将一个char转换成字符串
* @param {Object} bytes
*/
function charsToString (_s){

    _s = _s.replace(/(^\s*)|(\s*$)/g, "");

    var _r = "";

    for(var i in _s){

        _r += String.fromCharCode(_s[i]);

    }

    return _r;

}

你可能感兴趣的:(javascript)