Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        


Travis status


Dependency status


devDependency status


npm version


jsDelivr hits


bettercodehub score


Coverage Status

## 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
```