List.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a description of the values in the list.
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 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.
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;
}