Home > Mobile >  Is there a way to know the number of characters in a string?
Is there a way to know the number of characters in a string?

Time:02-23

This question concerns unicode characters that are more than one utf-16 character

string.length returns the number of unicode 16 chars in the string. But what about the case of characters that are more than 1 unicode 16 character? Is it possible to get the actual number of characters as well as "true" values from string.charAt of the actual character, and not the utf-16 pieces?

var test = "           
  • Related