using System.Collections.Generic;
public static void Main()
var list = new List<int>(){1, 5, 6, 9, 0, 1, 4, 8};
list.RemoveElementBiggerThan(5);
list.ForEach(i => Console.WriteLine(i));
Console.WriteLine("Hello World");
public static class StringListExtensions
public static void RemoveElementBiggerThan(this List<int> list, int maxValue)
if (list is null) throw new ArgumentNullException(nameof(list));
for (int i = list.Count - 1; i >= 0; i--)
public static bool IsPresentValue(this IEnumerable<string> list, string valueToSearch)
if (list is null) return true;
foreach (var elem in list)
if (elem == valueToSearch) return true;