So what about the people stuck in .Net 2.0/3.0 land?
On Oct 6, 1:06 pm, "Nathan Stott" <[EMAIL PROTECTED]> wrote:
> Is your problem with the standard Linq operators that your RemoveAll
> is complaining about altering an enumerable while iterating over it?
>
> As far as your FindAll, that could just be replaced by using Where
> from System.Linq.
>
> On Mon, Oct 6, 2008 at 12:59 PM, Bill Barry <[EMAIL PROTECTED]> wrote:
>
> > Shane C wrote:
> >> In my dream world I own so may cars I forget which ones have turbo
> >> chargers.. so..
>
> >> List<Car> myCars = new List<Car>();
>
> >> List<Car> myCarsWithTurbo = cars.FindAll(t => t.HasTurbo)
>
> > List<Car> myCarsWithTurbo = cars.Where(t=>t.HasTurbo).ToList();
> > though it very well may be better to not convert it to a list
>
> >> OR more importantly I want to get rid of my cars that don't have turbo
> >> charges since they're so dang slow...
>
> >> List<Car> myCars = new List<Car>();
>
> >> myCars.RemoveAll(t => !t.HasTurbo);
>
> > mycars.Where(t=>!t.HasTurbo)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---