using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
var list = new List<int> { 1, 2, 3 };
foreach(var a in list)
if (a == 2) {
list.RemoveAll(x => x == 2);
break;
}
list.ForEach(i => Console.Write("{0}\t", i));