SetEnumerator.ToString Method

Definition

Retrieves a description of the contents of the element in the set that the enumerator currently points to.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Returns

A string that contains a description of the current element in the set.

Remarks

The following example creates a set of integers, and then prints the content of the first and second elements in the set.

{ 
    Set mySet = new Set(Types::Integer); 
    SetEnumerator  enumerator; 
    int i; 
     // Add some elements to the set. 
    for (i = 0; i < 10; i++) 
    { 
        mySet.add(i); 
    } 
    // Set the enumerator. 
    enumerator = mySet.getEnumerator(); 
    // Go to the beginning of the enumerator. 
    enumerator.reset(); 
    // Go to the first element in the set. 
    enumerator.moveNext(); 
    // Print the first item in the set. 
    print enumerator.toString(); 
    pause; 
    enumerator.moveNext(); 
    // Print the second element in the set. 
    print enumerator.toString(); 
    pause; 
}

Applies to