using System.Collections.Generic;
using System.Globalization;
public static void Main()
var monthNames = Enumerable.Range(1, 12).Select((index) => DateTimeFormatInfo.CurrentInfo.GetMonthName(index)).ToList();
Index indexer = new Index(monthNames.FindIndex(item => item.Equals("april", StringComparison.OrdinalIgnoreCase)));
var fourMonths = monthNames.ByIndex(indexer.Value, 4);
Console.WriteLine(string.Join(",", fourMonths));
Console.WriteLine($"list[^1] => {list[^1]}");
var monthNamesArray = Enumerable.Range(1, 12).Select((index) => DateTimeFormatInfo.CurrentInfo.GetMonthName(index)).ToArray();
Range firstFourRange = ..4;
Console.WriteLine(string.Join(",", monthNamesArray[firstFourRange]));
public static List<T> ByIndex<T>(this List<T> value, int startIndex, int endIndex) => value.GetRange(startIndex, endIndex);