https://github.com/xotic750/trim-x
This method removes whitespace from the left and right end of a string.
https://github.com/xotic750/trim-x
browser ecmascript5 nodejs string trim
Last synced: 8 months ago
JSON representation
This method removes whitespace from the left and right end of a string.
- Host: GitHub
- URL: https://github.com/xotic750/trim-x
- Owner: Xotic750
- License: other
- Created: 2017-07-12T13:55:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:13:38.000Z (over 3 years ago)
- Last Synced: 2025-04-27T19:06:31.004Z (about 1 year ago)
- Topics: browser, ecmascript5, nodejs, string, trim
- Language: JavaScript
- Size: 2.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## trim-x
This method removes whitespace from the start and end of a string.
### `module.exports(string)` ⇒ number ⏏
### `trim-x` ⇒ string
This method removes whitespace from the start and end of a string. (ES2019)
**Kind**: static property of [trim-x](#module_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**
```js
import trim from 'trim-x';
console.log(trim(' \t\na \t\n') === 'a'); // true
```