SALES: 1-800-867-1380
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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]".

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.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft