Share via


Set.ToString Method

Definition

Returns a string describing the contents of the set.

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

Returns

A string that describes the contents of the set.

Remarks

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

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; 
}

Applies to