Skip to content

Instantly share code, notes, and snippets.

@devmobasa
Last active January 6, 2018 09:31
Show Gist options
  • Select an option

  • Save devmobasa/3d3fbfae19de6b9d6845e96682f88034 to your computer and use it in GitHub Desktop.

Select an option

Save devmobasa/3d3fbfae19de6b9d6845e96682f88034 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Linq;
namespace CSharp71Features
{
class Program
{
static void Main(string[] args)
{
var numbers = new List<int> { 33, 15, 14 };
var (lowest, highest) = GetSomeTuple(numbers);
}
private static (int lowest, int highest) GetSomeTuple(List<int> numbers)
{
int lowest = numbers.Min(n => n);
int highest = numbers.Max(n => n);
return (lowest, highest);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment