trim-x
This method removes whitespace from the left and right end of a string.
Version: 3.0.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
trim-x.trim
A reference to trim2018.
Kind: static property of trim-x
trim-x.trim2016 ⇒ string
This method removes whitespace from the left and right end of a string. (ES2016)
Kind: static property of trim-x
Returns: string - The trimmed string.
Throws:
TypeErrorIf string is null or undefined or not coercible.
| Param | Type | Description |
|---|---|---|
| string | string |
The string to trim the whitespace from. |
Example
var trim = require('trim-x');
trim(' \t\na \t\n') === 'a'; // true
trim-x.trim2018 ⇒ string
This method removes whitespace from the left and right end of a string. (ES2018)
Kind: static property of trim-x
Returns: string - The trimmed string.
Throws:
TypeErrorIf string is null or undefined or not coercible.
| Param | Type | Description |
|---|---|---|
| string | string |
The string to trim the whitespace from. |
Example
var trim = require('trim-x');
trim(' \t\na \t\n') === 'a'; // true