How to get items in a specific range (3 – 7) from list?

The method you are seeking is GetRange:

List<int> i = new List<int>();
List<int> sublist = i.GetRange(3, 4);

var filesToDelete = files.ToList().GetRange(2, files.Length - 2);

From the summary:

// Summary:
//     Creates a shallow copy of a range of elements in the source System.Collections.Generic.List<T>.
// Parameters:
//   index:
//     The zero-based System.Collections.Generic.List<T> index at which the range
//     starts.
//   count:
//     The number of elements in the range.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)