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> オブジェクトの文字列表現。

次の例では、 Tuple<T1,T2,T3,T4,T5,T6,T7> 1950 年から 2000 年までの国勢調査ごとにニューヨーク市の人口データを含むオブジェクトを定義します。 その後、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)

注釈

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

適用対象