EN: Truncate string, Chinese characters count as 2 bytes.
ZH: 截取字符串,中文算 2 个字节。
Usage:
const ret = cutZHString('hello world', 5);console.log(ret); Copy
const ret = cutZHString('hello world', 5);console.log(ret);
Output:
hello Copy
hello
要截取的字符串
Optional
返回截取后的字符串
EN: Truncate string, Chinese characters count as 2 bytes.
ZH: 截取字符串,中文算 2 个字节。
Usage:
Output: