https://github.com/msvbg/string-slice
Unicode-friendly version of String.prototype.slice.
https://github.com/msvbg/string-slice
Last synced: about 1 year ago
JSON representation
Unicode-friendly version of String.prototype.slice.
- Host: GitHub
- URL: https://github.com/msvbg/string-slice
- Owner: msvbg
- License: mit
- Created: 2015-01-08T09:21:30.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-08T09:21:41.000Z (over 11 years ago)
- Last Synced: 2025-04-26T08:45:03.291Z (about 1 year ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# string-slice
> An implementation of String.prototype.slice that works with arbitrary strings, including those containing astral symbols.
## Install
```sh
$ npm install --save string-slice
```
## Usage
The API is identical to that of `String.prototype.slice`.
```js
stringSlice('foobar', 1, 3);
// => 'oo'
stringSlice('𝐀𝐁𝐂𝐃', -1));
// => '𝐃'
```
## License
MIT © Martin Svanberg