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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    68
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    68
  • 2.0.1
    0
  • 2.0.0
    0
  • 1.1.1
    1,333
  • 1.1.0
    0
  • 1.0.0
    21,501

Package Sidebar

Install

npm i unicode-string

Weekly Downloads

18,719

Version

2.1.0

License

CC0-1.0

Unpacked Size

2.96 kB

Total Files

9

Last publish

Collaborators

  • michaelrhodes