Sorry if the question is silly. I need to count real number of chars in a string. For example I have the following string:
हा य
With .length
I have the following result:
let chars = "हा य";
console.log(chars.length);
for(var i = 0; i < chars.length; i++){
console.log(chars[i]);
}
As you can see, it's wrong. I have three chars here:
This one - हा
, - this one (empty space) and
य
this one. Which is proper and shortest way to count it correctly?