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 -> string
Public Overrides Function ToString () As String
この Tuple<T1,T2,T3,T4,T5,T6> オブジェクトの文字列表現。
次の例では、 Tuple<T1,T2,T3,T4,T5,T6> 1960 年から 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", 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、Item4、)、Item1、Item2、Item5, Item6
Item3、Item4、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 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。