Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/trim-right-x
This method removes whitespace from the right end of a string.
https://github.com/xotic750/trim-right-x
browser ecmascript nodejs trimming
Last synced: 3 months ago
JSON representation
This method removes whitespace from the right end of a string.
- Host: GitHub
- URL: https://github.com/xotic750/trim-right-x
- Owner: Xotic750
- License: mit
- Created: 2017-03-16T14:58:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:54:30.000Z (about 2 years ago)
- Last Synced: 2024-04-25T23:21:26.092Z (9 months ago)
- Topics: browser, ecmascript, nodejs, trimming
- Language: JavaScript
- Size: 2.44 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## trim-right-x (a.k.a trimEnd in ES2019)
This method removes whitespace from the end of a string.
### `module.exports(string)` ⇒
number
⏏### `trim-right-x` ⇒
string
This method removes whitespace from the end of a string. (ES2019)
**Kind**: static property of [
trim-right-x
](#module_trim-right-x)
**Returns**:string
- The right trimmed string.
**Throws**:-
TypeError
If string is null or undefined or not coercible.| Param | Type | Description |
| ------ | ------------------- | ------------------------------------------------- |
| string |string
| The string to trim the right end whitespace from. |**Example**
```js
import trimEnd from 'trim-right-x';console.log(trimEnd(' \t\na \t\n') === ' \t\na'); // true
```