问题描述
javascript将汉字转换成二进制
解决方案
function getCharBinary(str) {var i = 0;var result = "";while (true) {var temp = str.charCodeAt(i++);if (temp) {result += temp.toString(2);} else{break;}}return result;}
时间: 2025-01-26 14:13:48
javascript将汉字转换成二进制
function getCharBinary(str) {var i = 0;var result = "";while (true) {var temp = str.charCodeAt(i++);if (temp) {result += temp.toString(2);} else{break;}}return result;}