高手进来看看,谢谢!
下面代码,如果不用两个集合,要怎么实现删除集合中的bbb   
 现程序错误提示为:集合已修改;可能无法执行枚举操作 
    List <string>    myList   =   new   List <string> (); 
                         myList.Add( "aaa "); 
                         myList.Add( "bbb "); 
                         myList.Add( "ccc "); 
                         myList.Add( "bbb ");   
                         foreach   (string   myStr   in   myList) 
                         { 
                                     if   (myStr.ToString()   ==    "bbb ") 
                                     { 
                                                 myList.Remove(myStr); 
                                     } 
                         }
------解决方案--------------------for(int i=0;i <List.items.count;i++) 
         { 
             if (List[i].ToString() ==  "bbb ") 
             { 
                 List[i].remove(); 
             } 
         }
------解决方案--------------------foreach里的循环变量是一个只读的变量(自己想想为什么哦)   
 所以可以用楼上的方案解决
------解决方案--------------------for(int i=List.items.count-1;i> 0;i--) 
 { 
      if(List.items[i].value== "bbb ") 
      { 
           List.items.removeAt(i);  
      } 
 }