Advertisement
elena1234

Better Than Tuple - new sintax

Apr 30th, 2021
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace BetterThanTuple
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var result = GetResultAndName();
  10.             Console.WriteLine(result.name);
  11.             Console.WriteLine(result.price);
  12.         }
  13.  
  14.         public static (int price, string name) GetResultAndName()
  15.         {
  16.             return (4, "Pesho");
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement