Java Reference
In-Depth Information
"Java" + "Script" + " " + "Ninja";
<< "JavaScript Ninja"
The trim() method will remove any whitespace from the beginning and end of a string:
" Hello World ".trim();
// the space in the middle will be preserved
<< "Hello World"
" \t\t JavaScript Ninja! \r".trim();
// escaped tabs and carriage returns are also removed
<< "JavaScript Ninja!"
Note: Support for trim()
The trim() method was a relatively recent addition to the collection of
string methods so is not supported in older browsers.
Search WWH ::

Custom Search