Tuple<T1,T2,T3,T4,T5,T6>.ToString 메서드

정의

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> 개체의 문자열 표현입니다.

예제

다음 예제에서는 1960년부터 2000년까지의 각 인구 조사에 대한 뉴욕시의 인구 데이터를 포함하는 개체를 정의 Tuple<T1,T2,T3,T4,T5,T6> 합니다. 그런 다음 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, Item5, Item6)을 사용합니다. 여기서 Item1, Item2, Item3, Item4, Item5Item6은 각각 , , Item2, Item3Item4, Item5Item6 속성의 Item1값을 나타냅니다. 속성 값이 인 null경우 로 표시됩니다 String.Empty.

적용 대상