List.toString Method

Returns a description of the values in the list.

Syntax

public str toString()

Run On

Called

Return Value

Type: str
A string that describes the values of the elements in the list.

Remarks

To print a description of the type of the elements in the list, use the List.definitionString method.

Examples

The following example creates a list of integers. The toString method is used to print a description of the values in the list.

{ 
    // Create a list of integers 
    List il = new List(Types::Integer); 
  
    // Add some elements to the list 
    il.addEnd(1); 
    il.addEnd(2); 
    il.addStart(3); 
  
    // Print a description of the list 
    print il.definitionString(); 
    print il.toString(); 
    pause; 
}

See Also

List Class

List.definitionString Method