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

定義

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

public:
 override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返品

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

次の例では、1950 年から 2000 年までの国勢調査ごとのニューヨーク市の人口データを含む Tuple<T1,T2,T3,T4,T5,T6,T7> オブジェクトを定義します。 その後、sextuple のコンポーネントは、 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、Item2Item3Item4) を受け取ります。Item5, Item6, Item7Item2Item3Item4Item5Item6Item7 は、それぞれItem1Item2Item3Item4Item5Item6、およびItem7プロパティの値を表します。 いずれかのプロパティ値が nullされている場合は、 String.Emptyとして表されます。

適用対象