Share via


Array.toString Method

Returns a string that describes the contents of the array.

Syntax

public str toString()

Run On

Called

Return Value

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

Examples

The following example creates an array of integers and adds some values to it. The toString method is used to print the values that the array holds.

{ 
    Array     myArray; 
  
    Set set1 = new Set(Types::Integer); 
    Set set2 = new Set(Types::Integer); 
    int i; 
 
  
    myArray = new Array(Types::Integer); 
  
    // Add some values to the array. 
    for (i = 1; i< 10; i++) 
    { 
        myArray.value(i, i*2); 
    } 
  
    // Print out the values in the array. 
    print myArray.toString(); 
    pause; 
}

See Also

Array Class

Array.definitionString Method