Last active
August 29, 2015 14:27
-
-
Save sylvia43/0c55f2db6af67da17df3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean containsEmoji(String string) { | |
// if you're doing it frequently, move the pattern compile into a static / member variable instead | |
Pattern p = Pattern.compile("[\\uD83C-\\uDBFF\\uDC00-\\uDFFF]+"); | |
Matcher m = p.matcher(string); | |
return m.find(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment