Elements: Last

CSharp · Console

/Program.cs

using System;
using System.Linq;
					
public class Program
{
	public static void Main()
	{
		var numbers = new[] { 2, 4, 6, 8, 10 };

		int last = numbers.Last(i => i > 6);
		
		Console.WriteLine(last);
	}
}
;