/

HTML / CSS / JavaScript Tutorial

JavaScript String method: trim()

[this page | pdf | back links]

The trim() method (when applied to a JavaScript string) returns a string with whitespace (i.e. spaces) removed from start and finish of string.

 

It has the following syntax (with no parameters):

 

string.trim()

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript String Variables


Desktop view | Switch to Mobile