Set.toString Method

Returns a string describing the contents of the set.

Syntax

public str toString()

Run On

Called

Return Value

Type: str
A string that describes the contents of the set.

Remarks

Use the to get the description of a single element within a set.

Examples

The following example creates a set of strings, and then prints out a description of the set and a description of the set contents.

{ 
    // Declare a set of strings 
    Set names = new Set (Types::String); 
    ; 
    // Add some values to the set. 
    names.add("Peter"); 
    names.add("Paul"); 
    names.add("Mary"); 
    print names.definitionString(); 
    print names.toString(); 
    pause; 
}

See Also

Set Class

Set.definitionString Method