Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/trim-right
Similar to String#trim() but removes only whitespace on the right
https://github.com/sindresorhus/trim-right
Last synced: about 1 month ago
JSON representation
Similar to String#trim() but removes only whitespace on the right
- Host: GitHub
- URL: https://github.com/sindresorhus/trim-right
- Owner: sindresorhus
- License: mit
- Archived: true
- Created: 2015-02-17T03:45:37.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-07-09T17:13:09.000Z (over 3 years ago)
- Last Synced: 2024-04-14T11:09:17.308Z (7 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 21
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs - trim-right - Similar to String#trim() but removes only whitespace on the right. (Repository / Text/String)
README
Deprecated in favor of `String#trimEnd`.
---
# trim-right
> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only whitespace on the right
## Install
```
$ npm install trim-right
```## Usage
```js
import trimRight from 'trim-right';trimRight(' unicorn ');
//=> ' unicorn'
```## Related
- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left
- [`trim-off-newlines`](https://github.com/stevemao/trim-off-newlines) - Similar to `String#trim()` but removes only newlines---
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.