How to remove element from a list by value in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

class Program
{
    static void Main() {
        var list = new List<int>() { 2, 4, 9, 7, 3, 6, 0, 8 };
        
        list.Remove(6);

        Console.WriteLine(string.Join(" ", list));
    }
}




/*
run:

2 4 9 7 3 0 8

*/

 



answered Mar 9, 2023 by avibootz

Related questions

1 answer 114 views
1 answer 189 views
2 answers 235 views
1 answer 160 views
1 answer 109 views
109 views asked Feb 28, 2023 by avibootz
1 answer 169 views
1 answer 121 views
...