Tuple<T1,T2,T3,T4,T5,T6>.ToString 方法 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回表示此 Tuple<T1,T2,T3,T4,T5,T6> 实例的值的字符串。
public:
 override System::String ^ ToString();public override string ToString();override this.ToString : unit -> stringPublic Overrides Function ToString () As String返回
此 Tuple<T1,T2,T3,T4,T5,T6> 对象的字符串表示形式。
示例
以下示例定义一个 Tuple<T1,T2,T3,T4,T5,T6> 对象,该对象包含纽约市从 1960 年到 2000 年每次人口普查的人口数据。 然后,通过调用 ToString 方法来显示性元素的组件。
using System;
public class Example
{
   public static void Main()
   {
      // Get population data for New York City, 1960-2000.
      var population = Tuple.Create("New York", 7781984, 7894862, 
                                    7071639, 7322564, 8008278);
      Console.WriteLine(population.ToString());
   }
}
// The example displays the following output:
//    (New York, 7781984, 7894862, 7071639, 7322564, 8008278)
open System
// Get population data for New York City, 1960-2000.
let population = Tuple.Create("New York", 7781984, 7894862, 7071639, 7322564, 8008278)
printfn $"{population.ToString()}"
// The example displays the following output:
//    (New York, 7781984, 7894862, 7071639, 7322564, 8008278)
Module Example
   Public Sub Main()
      ' Get population data for New York City, 1960-2000.
      Dim population = Tuple.Create("New York", 7781984, 7894862, 
                                    7071639, 7322564, 8008278)
      Console.WriteLine(population.ToString())                                 
   End Sub
End Module
' The example displays the following output:
'       (New York, 7781984, 7894862, 7071639, 7322564, 8008278)
注解
此方法返回的字符串采用 Item1、Item2、Item3、Item4Item5, Item6、)  (的形式,其中 Item1、Item2、Item3、Item4、Item5 和 Item6 分别表示 、Item2、、Item3Item4、 Item5和 Item6 属性的值。Item1 如果任何属性值为 null,则表示为 String.Empty。