trim (JavaScript)
Removes white space from both ends of a string.
Defined in
String (Standard - JavaScript)Syntax
trim() : string| Return value | Description |
|---|---|
string |
The string with white space removed. |
Examples
The following example printsParis
Moscow Tokyo.var cities = new String(" Paris Moscow Tokyo ");
cities.trim()