This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rtrim

1.0.1 • Public • Published

rtrim

rtrim Node.js module returns a string with whitespace (or other characters) stripped from the end of a string. Without dependencies and library bloat.

Build Status Code Climate Known Vulnerabilities

Install

npm install rtrim

or

yarn add rtrim

Usage

rtrim(str[, chars])
Parameter Description
str The input string
chars Characters that you want to be stripped

Without the second parameter, rtrim will strip whitespaces (spaces, tabs and new lines).

Examples

var rtrim = require('rtrim');
 
/* Strip whitespace from the end of a string */
rtrim('    Hello    ') + ' World' // →    Hello World
 
/* Strip multiple special chars from the end of a string */
rtrim('... Hello World ...', ' .'); // →... Hello World
 
/* Strip multiple chars from the end of a string */
rtrim('Hello World', 'Hdle'); // →Hello Wor
 
/* Strip trailing slash from the end of a string */
rtrim('https://goo.gl/', '/'); // →https://goo.gl

Readme

Keywords

Package Sidebar

Install

npm i rtrim

Weekly Downloads

3,332

Version

1.0.1

License

MIT

Unpacked Size

4.54 kB

Total Files

5

Last publish

Collaborators

  • npm