Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xudafeng/power-string
the missing utilities of String
https://github.com/xudafeng/power-string
chinese-characters unicode utility
Last synced: 21 days ago
JSON representation
the missing utilities of String
- Host: GitHub
- URL: https://github.com/xudafeng/power-string
- Owner: xudafeng
- Created: 2015-05-18T12:54:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-05-23T15:15:36.000Z (over 2 years ago)
- Last Synced: 2024-10-06T18:16:42.474Z (about 1 month ago)
- Topics: chinese-characters, unicode, utility
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# power-string
[![NPM version][npm-image]][npm-url]
[![build status][ci-image]][ci-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url][npm-image]: https://img.shields.io/npm/v/power-string.svg
[npm-url]: https://npmjs.org/package/power-string
[ci-image]: https://github.com/xudafeng/power-string/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/xudafeng/power-string/actions/workflows/ci.yml
[coveralls-image]: https://img.shields.io/coveralls/xudafeng/power-string.svg
[coveralls-url]: https://coveralls.io/r/xudafeng/power-string?branch=master
[node-image]: https://img.shields.io/badge/node.js-%3E=_8-green.svg
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/power-string.svg
[download-url]: https://npmjs.org/package/power-string> the missing utilities of String
## Installment
```bash
$ npm i power-string --save-dev
```## Usage
```javascript
const PowerString = require('power-string');
const {
isChineseLetter,
getLength,
sliceString,
splitToArray
} = PowerString;isChineseLetter('中'); // true
getLength('中'); // 2
sliceString('这是一句中文', 4); // 这是
splitToArray('这是一句中文+123456', 4); // [ '这是', '一句', '中文', '+123', '456' ]
```## Contributors
|[
xudafeng](https://github.com/xudafeng)
|[
snapre](https://github.com/snapre)
|
| :---: | :---: |This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon May 23 2022 15:14:54 GMT+0000`.
## License
The MIT License (MIT)