xudafeng / power-string

the missing utilities of String

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

power-string

NPM version build status Test coverage node version npm download

the missing utilities of String

Installment

$ npm i power-string --save-dev

Usage

const PowerString = require('power-string');
const {
  isChineseLetter,
  getLength,
  sliceString,
  splitToArray
} = PowerString;

isChineseLetter('中'); // true
getLength('中'); // 2
sliceString('这是一句中文', 4); // 这是
splitToArray('这是一句中文+123456', 4); // [ '这是', '一句', '中文', '+123', '456' ]

Contributors


xudafeng


snapre

This project follows the git-contributor spec, auto updated at Mon May 23 2022 15:14:54 GMT+0000.

License

The MIT License (MIT)

About

the missing utilities of String


Languages

Language:JavaScript 100.0%