normalize-space-x
Strips leading and trailing white-space from a string, replaces sequences of
whitespace characters by a single space, and returns the resulting string.
Requires ES3 or above.
Version: 1.1.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(string)
⇒ string
⏏
This method strips leading and trailing white-space from a string,
replaces sequences of whitespace characters by a single space,
and returns the resulting string.
Kind: Exported function
Returns: string
- The normalized string.
Param | Type | Description |
---|
string | String | The string to be normalized. |
Example
var trimRight = require('normalize-space-x');
normalizeSpace(' \t\na \t\nb \t\n) === 'a b'; // true