Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
System Namespace
Tuple Class
Collapse All/Expand All Collapse All
.NET Framework Class Library
Tuple Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides static methods for creating tuple objects.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
Public NotInheritable Class Tuple
Visual Basic (Usage)
You do not need to declare an instance of a static class in order to access its members.
C#
public static class Tuple
Visual C++
public ref class Tuple abstract sealed
F#
[<AbstractClassAttribute>]
[<SealedAttribute>]
type Tuple =  class end

Tuple is a factory class that provides static methods for creating instances of the tuple types supported by the .NET Framework. It provides helper methods that can be called to instantiate particular tuple objects without requiring that you explicitly specify the type of each tuple component.

Helper methods directly support the creation of tuple objects that have from one to eight components (that is, singletons through octuples). Although there is no practical limit to the number of components a tuple may have, helper methods are not available to create a tuple with nine or more components. To create such a tuple, you must call the constructor.

The following example creates an 8-tuple (octuple) that contains prime numbers that are less than 20.

Visual Basic
Dim primes = Tuple.Create(2, 3, 5, 7, 11, 13, 17, 19)
C#
var primes = Tuple.Create(2, 3, 5, 7, 11, 13, 17, 19);
System..::.Object
  System..::.Tuple
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker