JS 5 ways to judge string length (distinguish Chinese from English)
- 2020-03-30 02:22:24
- OfStack
Purpose: to calculate the length of the string (1 character in English, 2 characters in Chinese)
Purpose: to calculate the length of the string (1 character in English, 2 characters in Chinese)