I would like to detect if a string contains emoji in Java.
I tried https://github.com/vdurmont/emoji-java but it is not maintained anymore and fails on new emojis.
For example - the following test fails:
EmojiManager.containsEmoji("This string contains beans 🫘") shouldBe true
In Java 21 you will be able to use Character#isEmoji(int) to help you out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With