JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 650
  • Score
    100M100P100Q107098F
  • License MIT

Strip whitespace - or other characters - from the beginning of a string

Package Exports

  • ltrim

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ltrim) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

Build Status Code Climate Known Vulnerabilities

Install

npm install ltrim

or

yarn add ltrim

Usage

ltrim (str[, chars])
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 = require('ltrim');

/* Strip whitespace from the beginning of a string */
ltrim('    Hello    ') + ' World' // →Hello     World

/* Strip multiple special chars from the beginning of a string */
ltrim('... Hello World ...', ' .'); // →Hello World ...

/* Strip multiple chars from the beginning of a string */
ltrim('Hello World', 'Hdle'); // →o World

/* Strip url protocol from the beginning of a string */
ltrim('https://goo.gl/', '/:htps'); // →goo.gl/