Changes in new versions / C# 11.0

using System;

var nums = new[] { 12345 };
if (nums is [.., > 2, _, var odd] && odd % 2 == 1)
{
    Console.WriteLine($"last item {odd} is odd");
    // last item 5 is odd
}

bool IsPalindrome(string str) => str switch
{
    [] => true,
    [_] => true,
    [char first, .. string middle, char last]
        => first == last && IsPalindrome(middle)
};

Console.WriteLine(IsPalindrome("civic"));
// True
Console.WriteLine(IsPalindrome("civil"));
// False


In this template:
- the first two numbers are skipped;
- the third must be greater than 2;
- the fourth is skipped;
- the fifth is saved in the odd variable and checked for oddness.