I'm trying to extract emojis and other special Characters from Strings for further processing (e.g. a String contains '' as one of its Characters).
But neither string.charAt(i)
nor string.substring(i, i+1)
work for me. The original String is formatted in UTF-8 and this means, that the escaped form of the above emoji is encoded as '\uD83D\uDE05'. That's why I receive '?' (\uD83D) and '?' (\uDE05) instead for this position, causing it to be at two positions when iterating over the String.
Does anyone have a solution to this problem?