Tuple<T1,T2,T3,T4,T5,T6>.ToString Metoda

Definicja

Zwraca ciąg reprezentujący wartość tego Tuple<T1,T2,T3,T4,T5,T6> wystąpienia.

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

Zwraca

Reprezentacja ciągu tego Tuple<T1,T2,T3,T4,T5,T6> obiektu.

Przykłady

Poniższy przykład definiuje Tuple<T1,T2,T3,T4,T5,T6> obiekt, który zawiera dane populacji dla Nowego Jorku dla każdego spisu z 1960 do 2000 roku. Składniki sekstuple są następnie wyświetlane przez wywołanie ToString metody .

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)

Uwagi

Ciąg zwrócony przez tę metodę przyjmuje postać (Item1, Item2, Item3, Item4, Item5, Item6), gdzie Item1, Item2, Item3, Item4, Item5 i Item6 reprezentują odpowiednio wartości Item1właściwości , Item2, Item3, Item4, Item5i .Item6 Jeśli którakolwiek z wartości właściwości to null, jest reprezentowana jako String.Empty.

Dotyczy