trim-x
This method removes whitespace from the left and right end of a string.
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:
TypeError
If string is null or undefined or not coercible.
Param | Type | Description |
---|
string | string | The string to trim the whitespace from. |
Example
import {trim2016} from 'trim-x';
console.log(trim2016(' \t\na \t\n') === 'a');
trim-x
⇒ 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:
TypeError
If string is null or undefined or not coercible.
Param | Type | Description |
---|
string | string | The string to trim the whitespace from. |
Example
import trim from 'trim-x';
console.log(trim(' \t\na \t\n') === 'a');