trim( string )



This function trims all leading and trailing spaces from a string.

Parameters:

  • string – the string from which all leading and trailing spaces will be removed.

Example:

var myName = trim(" Michael "); // places "Michael" into myName