This method removes whitespace from the end of a string.
npm install trim-right-x href="https://travis-ci.org/Xotic750/trim-right-x"
title="Travis status"> src="https://travis-ci.org/Xotic750/trim-right-x.svg?branch=master"
alt="Travis status" height="18">
href="https://david-dm.org/Xotic750/trim-right-x"
title="Dependency status"> alt="Dependency status" height="18"/>
href="https://david-dm.org/Xotic750/trim-right-x?type=dev"
title="devDependency status"> alt="devDependency status" height="18"/>
href="https://badge.fury.io/js/trim-right-x"
title="npm version"> alt="npm version" height="18">
href="https://www.jsdelivr.com/package/npm/trim-right-x"
title="jsDelivr hits"> alt="jsDelivr hits" height="18">
href="https://bettercodehub.com/results/Xotic750/trim-right-x"
title="bettercodehub score"> alt="bettercodehub score" height="18">
href="https://coveralls.io/github/Xotic750/trim-right-x?branch=master"
title="Coverage Status"> alt="Coverage Status" height="18">
This method removes whitespace from the end of a string.
This method removes whitespace from the end of a string. (ES2019)
Kind: static property of 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
``