javascript中char解码为string(代码讲解)
程序员文章站
2023-11-09 12:24:04
javascript中char解码为string(代码讲解)
/**
* 将一个char转换成字符串
* @param {object} bytes
*/
funct...
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; }