barber-trim
v1.0.2
Published
Similar to 'string.prototype.trim' but also cuts successive spaces inside the phrase
Downloads
1
Readme
Barber-trim
The trim() is a built-in string function in JavaScript, which is used to trim a string.
Barber-trim cuts successive whitespaces inside strings as well. This can be very useful for natural language processing.
Example
All of us
except\tEmran, Raju and Noman were there.
becomes
All of us except Emran, Raju and Noman were there
Usage
import trim from "barber-trim"
const str = `
All of us
except\tEmran, Raju and Noman were there.
`;
console.log(trim(str))
Note
Please note that Tab ↹
spaces and ← Backspaces
are considered like regular spaces.
License
MIT