trim

Trims any leading and trailing whitespace from the specified variable.

Syntax:

$[ScriptVariable]::trim()

Parameters:

None

Example:

The following example illustrates the syntax for the trim string method:

$str = " first string "

$str::trim()

print($str)

Output:

first string