unicode-string

2.1.0 • Public • Published

unicode-string

a collection of unicode-aware string functions

ci

install

npm install https://pkg.mkr.sx/unicode-string/2.1.0.tgz

use

var unicode = require('unicode-string')
var string = 'o 🇨🇦'
 
string.length
> 6
unicode.length(string)
> 3
 
string.split('')
> ['o',' ','\ud83c','\udde8','\ud83c','\udde6']
unicode.split(string, '')
> ['o',' ','🇨🇦']
 
string.substring(2, 3)
> '\ud83c'
unicode.substring(string, 2, 3)
> '🇨🇦'
 
string.substr(2, 1)
> '\ud83c'
unicode.substr(string, 2, 1)
> '🇨🇦'
 
string.slice(0, -2)
> '\ud83c\udde8'
unicode.slice(string, 0, -2)
> 'o'

obey

CC0-1.0

Readme

Keywords

none

Package Sidebar

Install

npm i unicode-string

Weekly Downloads

12,705

Version

2.1.0

License

CC0-1.0

Unpacked Size

2.96 kB

Total Files

9

Last publish

Collaborators

  • michaelrhodes