Posts

Showing posts with the label Emoji

Android - How To Filter Emoji (emoticons) From A String?

Answer : Emojis can be found in the following ranges ( source ) : U+2190 to U+21FF U+2600 to U+26FF U+2700 to U+27BF U+3000 to U+303F U+1F300 to U+1F64F U+1F680 to U+1F6FF You can use this line in your script to filter them all at once: text.replace("/[\u2190-\u21FF]|[\u2600-\u26FF]|[\u2700-\u27BF]|[\u3000-\u303F]|[\u1F300-\u1F64F]|[\u1F680-\u1F6FF]/g", ""); Latest emoji data can be found here: http://unicode.org/Public/emoji/ There is a folder named with emoji version. As app developers a good idea is to use latest version available. When You look inside a folder, You'll see text files in it. You should check emoji-data.txt. It contains all standard emoji codes. There are a lot of small symbol code ranges for emoji. Best support will be to check all these in Your app. Some people ask why there are 5 digit codes when we can only specify 4 after \u. Well these are codes made from surrogate pairs. Usually 2 symbols are used to encode one...