trim

This function can be used to remove all white-space characters from both the start and end of a string. Whitespace characters include spaces, tabs, new-line characters etc.

This function does not generate an event.

Function

str.trim()

Arguments

None

Return value

Returns a new string with whitespace characters removed from the start and end of the string.

See also

Example

Example using trim():

'  Hello World!!  '.trim();

Return value in JSON format

"Hello World!!"