https://github.com/vutran/trim-char
:scissors: Trim characters from a string.
https://github.com/vutran/trim-char
char characters string stripe trim
Last synced: over 1 year ago
JSON representation
:scissors: Trim characters from a string.
- Host: GitHub
- URL: https://github.com/vutran/trim-char
- Owner: vutran
- License: mit
- Created: 2017-03-01T01:36:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T03:18:09.000Z (about 9 years ago)
- Last Synced: 2024-05-02T05:43:34.595Z (about 2 years ago)
- Topics: char, characters, string, stripe, trim
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# trim-char
[](https://travis-ci.org/vutran/trim-char) [](https://coveralls.io/github/vutran/trim-char) [](LICENSE)
> Trim characters from a string.
## Install
```bash
$ npm install --save trim-char
```
## Usage
```js
import trim from 'trim-char';
trim('foobar', 1); // -> ooba
trim('foobar', 2); // -> ob
```
## API
### trim(value, length)
Trims the value on both ends.
#### value
Type: `String`
The string to trim.
#### length
Type: `Number`
How much characters to cut off on each end.
## License
MIT © [Vu Tran](https://github.com/vutran/)