Tuple<T1,T2,T3,T4,T5,T6,T7>.ToString 方法 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回表示此 Tuple<T1,T2,T3,T4,T5,T6,T7> 实例的值的字符串。
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,T7> 对象的字符串表示形式。
示例
以下示例定义一个 Tuple<T1,T2,T3,T4,T5,T6,T7> 对象,该对象包含 1950 到 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", 7891957, 7781984, 
                                    7894862, 7071639, 7322564, 8008278);
      Console.WriteLine(population.ToString());
   }
}
// The example displays the following output:
//    (New York, 7891957, 7781984, 7894862, 7071639, 7322564, 8008278)
open System
// Get population data for New York City, 1960-2000.
let population = 
    Tuple.Create("New York", 7891957, 7781984, 7894862, 7071639, 7322564, 8008278)
printfn $"{population}"
// The example displays the following output:
//    (New York, 7891957, 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", 7891957, 7781984, 
                                    7894862, 7071639, 7322564, 8008278)
      Console.WriteLine(population.ToString())                                 
   End Sub
End Module
' The example displays the following output:
'       (New York, 7891957, 7781984, 7894862, 7071639, 7322564, 8008278)
注解
此方法返回的字符串采用 (Item1、Item2、Item3、Item4Item5, Item6, Item7、) 的形式,其中 Item1、Item2、Item3、Item4、Item5、Item6 和 Item7 分别表示 、、Item2、Item5Item4Item3Item6、 和 Item7 属性的值。Item1 如果任一属性值为 null,则表示为 String.Empty。