trim() function

Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.

Syntax

trim(string)

Arguments

string → is string. The string to trim.

Example

trim(' hello world ') → 'hello world'