ltrim
ltrim
Node.js module returns a string with whitespace (or other characters) stripped from the beginning of a string. Without dependencies and library bloat.
Install
npm install ltrim
or
yarn add ltrim
Usage
Parameter | Description |
---|---|
str |
The input string |
chars |
Characters that you want to be stripped |
Without the second parameter, ltrim
will strip whitespaces (spaces, tabs and new lines).
Examples
var ltrim = ; /* Strip whitespace from the beginning of a string */ + ' World' // →Hello World /* Strip multiple special chars from the beginning of a string */; // →Hello World ... /* Strip multiple chars from the beginning of a string */; // →o World /* Strip url protocol from the beginning of a string */; // →goo.gl/