Skip to content

a native JS implementation of functions of dart characters library

License

Notifications You must be signed in to change notification settings

exactmultiple3425/dart-text

Repository files navigation

DartText

a native JS implementation of functions of dart characters library

Tested with support of Emoji V15 Spec

Installation

npm i dart-text

Usage

const dartText = require('dart-text');

dartText.length('👨‍👨‍👧‍👧');
// returns 1

dartText.substring('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', 7, 14);
// returns "👍🏽 are 🍆"

dartText.substr('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', 7, 1);
// returns "👍🏽"

dartText.split('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.');
// returns ['E','m','o','j','i','s',' ','👍🏽',' ','a','r','e',' ','🍆',' ','p','o','i','s','o','n','.',' ','🌮','s',' ','a','r','e',' ','b','a','d','.']

dartText.firstIndexOf('Emojis 👍🏽 are 🍆 poison. 🌮s are bad.', '👍🏽');
// returns 7

About

a native JS implementation of functions of dart characters library

Resources

License

Stars

Watchers

Forks

Packages

No packages published