How to realize full-width conversion to half-width function by JavaScript
This article is about how JavaScript can convert full-angle functions to half-angle functions. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
function toCDB(str) {
var result = "";
for (var i = 0; i
< str.length; i++) { code = str.charCodeAt(i); if (code >= 65281 && code