Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xotic750/trim-left-x

This method removes whitespace from the left end of a string
https://github.com/xotic750/trim-left-x

browser ecmascript left nodejs string trimming

Last synced: 3 months ago
JSON representation

This method removes whitespace from the left end of a string

Awesome Lists containing this project

README

        


Travis status


Dependency status


devDependency status


npm version


jsDelivr hits


bettercodehub score


Coverage Status

## trim-left-x (a.k.a trimStart in ES2019)

This method removes whitespace from the start of a string.

### `module.exports(string)` ⇒ number

### `trim-left-x` ⇒ string

This method removes whitespace from the left end of a string. (ES2019)

**Kind**: static property of [trim-left-x](#module_trim-left-x)
**Returns**: string - The left trimmed string.
**Throws**:

- TypeError If string is null or undefined or not coercible.

| Param | Type | Description |
| ------ | ------------------- | ------------------------------------------------ |
| string | string | The string to trim the left end whitespace from. |

**Example**

```js
import trimStart from 'trim-left-x';

console.log(trimStart(' \t\na \t\n') === 'a \t\n'); // true
```