Tuple Deconstruction Evaluation Ordering - CSharp Language Basics

CSharp examples for Language Basics:Tuple

Description

Tuple Deconstruction Evaluation Ordering

Demo Code

using System;//from  ww w  .  jav a 2 s  . co  m
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
class TupleDeconstructionEvaluationOrdering
{
   static void Main()
   {
      StringBuilder builder = new StringBuilder("12345");
      StringBuilder original = builder;
      (builder, builder.Length) = (new StringBuilder("67890"), 3);
      Console.WriteLine(original);
      Console.WriteLine(builder);
   }
}

Result


Related Tutorials