public enum MyEnum
{
    A,
    Ab,
    Abc,
    Abcd,
    Abcde
}
Using LINQ, I want to extract a list from MyEnum that contains all the items of MyEnum except the items Ab and Abc.
public enum MyEnum
{
    A,
    Ab,
    Abc,
    Abcd,
    Abcde
}
Using LINQ, I want to extract a list from MyEnum that contains all the items of MyEnum except the items Ab and Abc.
 
    
    var doNotUse = new[] { MyEnum.Ab, MyEnum.Abc };
var enums = Enum.GetValues(typeof(MyEnum)).Cast<MyEnum>()
    .Where(me => !doNotUse.Contains(me))
    .ToList();
 
    
    var list = Enum.GetNames(typeof(MyEnum))
               .Where(r=> r != "Abc" && r != "Ab")
               .ToList();
For output:
foreach(var item in list)
    Console.WriteLine(item);
Output:
A
Abcd
Abcde
 
    
    you don't need linq :
    public void test()
    {
        List<MyEnum> list = new List<MyEnum>();
        foreach (MyEnum item in Enum.GetValues(typeof(MyEnum)))
        {
            list.Add(item);
        }
    }
