Category Archives: LINQ

PHPHOST BLOG

Web Hosting Related Articles You May Need

List<T>.ConvertAll<>() with Lambda Expression

List<T> has many useful methods for dealing with sequences and collections. One such method is the ConvertAll<>() method. All those who have used the List<T>.ConvertAll<>() are aware how useful this method is to convert the curr… Continue reading

Posted in C#, LINQ, Syndicated | Comments Off on List<T>.ConvertAll<>() with Lambda Expression

List<T>.ConvertAll<>() with Lambda Expression

List<T> has many useful methods for dealing with sequences and collections. One such method is the ConvertAll<>() method. All those who have used the List<T>.ConvertAll<>() are aware how useful this method is to convert the curr… Continue reading

Posted in C#, LINQ, Syndicated | Comments Off on List<T>.ConvertAll<>() with Lambda Expression

LINQ: Generate a Cartesian Product

A Cartesian product by definition is a direct product of two sets. Take the following example. Assume you have these two lists:

{A, B, C} and {1, 2, 3}

A Cartesian product of the two lists would be the following:

{(A,1), (A,2), (A,3), (B,1), (B,2), … Continue reading

Posted in LINQ, Syndicated | Comments Off on LINQ: Generate a Cartesian Product

LINQ: Generate a Cartesian Product

A Cartesian product by definition is a direct product of two sets. Take the following example. Assume you have these two lists:

{A, B, C} and {1, 2, 3}

A Cartesian product of the two lists would be the following:

{(A,1), (A,2), (A,3), (B,1), (B,2), … Continue reading

Posted in LINQ, Syndicated | Comments Off on LINQ: Generate a Cartesian Product

LINQ: List Classes implementing the IEnumerable Interface

A DevCurry.com reader ‘Richard’ mailed me with a question. He wanted to know an easy way to find all the types that implement the IEnumerable interface, or for that matter, any interface. Here’s a piece of LINQ code that lists all the types imple… Continue reading

Posted in LINQ, Syndicated | Comments Off on LINQ: List Classes implementing the IEnumerable Interface

LINQ: List Classes implementing the IEnumerable Interface

A DevCurry.com reader ‘Richard’ mailed me with a question. He wanted to know an easy way to find all the types that implement the IEnumerable interface, or for that matter, any interface. Here’s a piece of LINQ code that lists all the types imple… Continue reading

Posted in LINQ, Syndicated | Comments Off on LINQ: List Classes implementing the IEnumerable Interface

Select Last N elements using LINQ to XML

Here’s a simple example of selecting the last ‘N’ elements of a XML document using LINQ to XMLConsider the following XML In order to select the last two elements, use the IEnumerable<XElement>.Reverse() which inverts the order of the elemen… Continue reading

Posted in LINQ, Syndicated | Comments Off on Select Last N elements using LINQ to XML

Select Last N elements using LINQ to XML

Here’s a simple example of selecting the last ‘N’ elements of a XML document using LINQ to XMLConsider the following XML In order to select the last two elements, use the IEnumerable<XElement>.Reverse() which inverts the order of the elemen… Continue reading

Posted in LINQ, Syndicated | Comments Off on Select Last N elements using LINQ to XML

Find Uppercase words in a String using C#

I am helping a friend to build an Editor API in C#. One of the functionalities in the Editor is to filter uppercase words in a string and highlight them. Here’s a sample of how uppercase words can be filtered in a stringstatic void Main(string[] args… Continue reading

Posted in LINQ, Syndicated | Comments Off on Find Uppercase words in a String using C#

Find Uppercase words in a String using C#

I am helping a friend to build an Editor API in C#. One of the functionalities in the Editor is to filter uppercase words in a string and highlight them. Here’s a sample of how uppercase words can be filtered in a stringstatic void Main(string[] args… Continue reading

Posted in LINQ, Syndicated | Comments Off on Find Uppercase words in a String using C#