This javascript library allows you perform splitting emoji string. If you want to extend this project to work with almost unicode string, you just need to extend the data file (append data into emoji.json).
You can make emoji string here to test https://www.emojionline.org
Online test here https://thanhdnh.github.io/emoji-splitter/
======================
*Required library: jquery.
*Required other data: emoji.json.
----------------------
In order to use this library, you need:
- Include jquery library before including this library.
- In your code editor, at the point you want to split emojis string, you need to do as following
var emojisplit = new EmojiSplit().create();
var result = emojisplit.splitBySymbol('I ❤ you 💏', '//');
Hints:
- You need call the method create before using splitBySymbol method.
- The splitBySymbol method has two parameters: the first parameter is input emoji string that you need split, the second parameter is the pattern symbol that you want to separate (this parameter is optional). This symbol need no appear in your emoji string. You can choose any symbols you want, just mismatch with any symbols in your input emoji string.
=======================
Here are some examples:
I ❤ you 💏 ==> I ,❤, you ,💏
This 🎄🎅🏼, my 👨👩👧👦 will go to 🗽 ==> This ,🎄,🎅🏼,, my ,👨👩👧👦, will go to ,🗽
👨🏾🎓👷🏿👸🏻👢👨👨👦👩👩👦💑🤦🏼🙋 ==> 👨🏾🎓,👷🏿,👸🏻,👢,👨👨👦,👩👩👦,💑,🤦🏼,🙋
This library works well on allmost browsers.