How do you check how many letters are in a Java string?
How do you check what letter is in a certain position in the string (i.e, the second letter of the string)?>
If you are counting letters, the above solution will fail for some unicode symbols. For example for these 5 characters sample.length() will return 6 instead of 5:
String sample = "\u760c\u0444\u03b3\u03b5\ud800\udf45"; // 瘌фγε