ToString Method
Collapse the table of content
Expand the table of content

KeyValuePair<TKey, TValue>.ToString Method ()

 

Returns a string representation of the KeyValuePair<TKey, TValue>, using the string representations of the key and value.

Namespace:   System.Collections.Generic
Assembly:  mscorlib (in mscorlib.dll)

public override string ToString()

Return Value

Type: System.String

A string representation of the KeyValuePair<TKey, TValue>, which includes the string representations of the key and value.

The string representation consists of the string representations of the key and value, separated by a comma and a space, and enclosed in square brackets. For example, the ToString method for a KeyValuePair<TKey, TValue> structure with the string Key "Test" and the integer Value 14 returns the string "[Test, 14]".

System_CAPS_noteNote

This method uses the ToString methods provided by the key and value types. Some types do not return useful or informative values for their ToString methods.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft