Click here to Skip to main content
15,896,118 members
Articles / Programming Languages / C#

Few extension methods of IEnumerable in C#

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
20 Jul 2011CPOL 5.8K   1  
public static IEnumerable MakeAllLower(this IEnumerable myList){ foreach (var item in myList) yield return item.ToLower();}Could be rewritten as:public static IEnumerable MakeAllLower(this IEnumerable myList){ return myList.Select(item...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
5 Jul 2011Mohammad A Rahman 3 alternatives  
Few extension methods of IEnumerable in C#
Please Sign up or sign in to vote.
18 Jul 2011SergeyT2
The codepublic static IEnumerable IfMatchWith(this IEnumerable myList, string itemToMatch){ foreach (var item in myList.Where(item => item == itemToMatch)) yield return item;}could be rewritten as:public static IEnumerable IfMatchWith(this...
Please Sign up or sign in to vote.
20 Jul 2011SergeyT2
myList.IfMatch...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions