1.3.3 • Published 9 years ago
trim-whitespace v1.3.3
trim whitespace
Remove leading and/or trailing spaces and tabs from each line of a string
Install
$ npm install trim-whitespace --saveUsage
Remove leading and trailing spaces and tabs from a string.
const trim = require('trim-whitespace');
trim('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n');
// \nAnakin Skywalker\nPadme Amidala\nRemove leading spaces and tabs from a string.
const { leading } = require('trim-whitespace');
leading('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n');
// \nAnakin Skywalker \t\nPadme Amidala\t \nRemove trailing spaces and tabs from a string.
const { trailing } = require('trim-whitespace');
trailing('\n \tAnakin Skywalker \t\n\t Padme Amidala\t \n');
// \n \tAnakin Skywalker\n\t Padme Amidala\nAPI
const trim = require('trim-whitespace');trim(str)
Returns a string without any leading or trailing spaces or tabs.
str
- type:
String
The string to trim.
trim.leading(str)
Returns a string without any leading spaces or tabs.
str
- type:
String
The string to trim.
trim.trailing(str)
Returns a string without any trailing spaces or tabs.
str
- type:
String
The string to trim.
1.3.3
9 years ago
1.3.2
9 years ago
1.3.1
9 years ago
1.3.0
9 years ago
1.2.4
9 years ago
1.2.3
9 years ago
1.2.2
9 years ago
1.2.1
10 years ago
1.2.0
10 years ago
1.1.7
10 years ago
1.1.6
10 years ago
1.1.5
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago