Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize full-width conversion to half-width function by JavaScript

Shulou Source: shulou.com Published: 2022-06-01 02:56:26 09月29日 Update

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

Tags: Function half-width full-width content more articles good practical articles read knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information macOS Huawei NVidia