Method String.trimAll
Removes redundant whitespace in the string.
-
Syntax
String String.trimAll()
Removes any whitespace character from before, after and redundant whitespace in the string.
Works for multiline text. - Return value A new string without leading, trailing and redundant whitespace.
-
Examples
- To remove all non needed whitespace
// Define string var s = ' A string with whitespace '; // Output is 'A string with whitespace' s.trimAll();
- Related String.trim String.trimLeft String.trimRight
-
Download
Source
Unless otherwise noted all code in the JSLab Standard Library is licensed as GPLv3. See http://www.gnu.org/licenses/gpl.html for the entire license.
