Syntax

	$string.trim()

trim($string)

Description

Removes all white space (spaces, tabs, line breaks, and other Unicode white space characters) at the beginning and at the end of the string string. White space inside the string is kept.

If string is null, the result is null. Other values are converted to a string first.

Parameters

Name Type Description Mandatory Default
string String String from which the white space is to be removed. yes

Return value

Type: String

string without leading and trailing white space, or null if string is null.

Examples

	trim("  Hello  world!  ")

Output: "Hello world!"