length

Returns the number of characters, including whitespace, of a string variable.

Syntax:

$[ScriptVariable]::length()

Parameters:

None

Example:

The following example illustrates the syntax for the length string method.

$str = "12345 6789"

$length = $str::length()

print($length)

Output:

10