Tuple<T1,T2,T3,T4,T5,T6>.ToString メソッド

定義

この Tuple<T1,T2,T3,T4,T5,T6> インスタンスの値を表す文字列を返します。

C#
public override string ToString();

戻り値

この Tuple<T1,T2,T3,T4,T5,T6> オブジェクトの文字列表現。

次の例では、 Tuple<T1,T2,T3,T4,T5,T6> 1960 年から 2000 年までの国勢調査ごとのニューヨーク市の人口データを含む オブジェクトを定義します。 その後、sextuple のコンポーネントは、 メソッドの ToString 呼び出しによって表示されます。

C#
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)

注釈

このメソッドによって返される文字列は、フォーム (Item1Item2、Item3Item4、)、Item1Item2Item5, Item6Item3Item4、Item5および Item6 の各プロパティのItem1Item2Item3Item4Item5Item6値を表します。 プロパティ値のいずれかが の場合は null、 として String.Empty表されます。

適用対象

製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0