I saw a comment here that all solutions with charAt
are wrong. I could not exactly understand and find something about charAt
on internet. As I look the source code it just returns an element from the char array. So my question is that if there any problem or issue about using charAt
?
Comment is like that
Strictly speaking, all the solutions based on charAt are wrong, as charAt doesn't give you the "character at", but the "code unit at", and there are code units that are not characters and characters that need multiple code units.
char
- only ones with a codepoint less than 65536. Characters like Emoji are outside that range. – Fictile