This package has been deprecated

Author message:

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

string-trimmer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

StringTrimmer

Strip whitespace or other characters.

This module help you strip whitespace or other characters, and it supports old browsers like IE8.

Install

npm install string-trimmer --save

Example

Import in HTML

<script src="string-trimmer.js"></script>

Or in Node.js/WebPack

const StringTrimmer = require("string-trimmer");
StringTrimmer.trim("  test  "); //=> "test"
StringTrimmer.trimLeft("  test  "); //=> "test  "
StringTrimmer.trimRight("  test  "); //=> "  test"
 
StringTrimmer.trim("test", "t"); //=> "es"
StringTrimmer.trim("testing", "ing"); //=> "test"
StringTrimmer.trimLeft("test", "t"); //=> "est"
StringTrimmer.trimRight("test", "t"); //=> "tes"
 
// Optionally, you could apply these methods to String.prototype.
StringTrimmer.applyTo(String.prototype);
 
" test ".trim(" t"); //=> "es"

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i string-trimmer

      Weekly Downloads

      0

      Version

      1.0.1

      License

      MIT

      Last publish

      Collaborators

      • ayonli