add

(List Object Variable Method)

The add() list object variable method adds the specified string as a list element to the end of the list variable. The add() method does not remove or replace any other elements in the list.

Syntax:

$[ScriptVariable]::add(String str)

Parameters:

str (String): the string to add to the list variable.

Example:

The following example illustrates proper usage for the add() list method:

$recipients = "Engineering Group"

$recipients::add("Building 14")

$recipients::add("Winston Smythe")

print($recipients)

Output:

['Engineering Group']['Building 14']['Winston Smythe']

The above example defines a $recipient list variable. This variable is used throughout the list variable methods as a default example.