Tuple Deconstruction Assignment - CSharp Language Basics

CSharp examples for Language Basics:Tuple

Description

Tuple Deconstruction Assignment

Demo Code

using System;/* w w  w  .ja v  a  2 s. com*/
using System.ComponentModel;
class TupleDeconstructionOverview
{
   static void Main()
   {
      var tuple = (10, "text");
      var (a, b) = tuple;
      (int c, string d) = tuple;
      int e;
      string f;
      (e, f) = tuple;
      Console.WriteLine($"a: {a}; b: {b}");
      Console.WriteLine($"c: {c}; d: {d}");
      Console.WriteLine($"e: {e}; f: {f}");
   }
}

Result


Related Tutorials