2.2.2 โข Published 1 year ago
dart-text v2.2.2
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