Category Results  

LINQ | Counting Operator | Count

Linq has a Count() operator which allows you to count the items which meets the condition in list or array.  You can use using data type’s operators to create a condition for list or array. Let’s take a look at the following example,

Read More
LINQ

LINQ | Grouping Operator | GroupBy

In LINQ, grouping is done by selecting items containing common features of the row or collection and presenting them in a group. In simple words, GroupBy groups the items according to the key. This group is kept in a special collection that occurs from Key and Element. Key is common feature where you want to […]

Read More
LINQ

Get min index of list in string

Here is an example about finding the minimum index of items in list for a given string. Min() method of LINQ returns the minimum index among the items of list by comparing the index of them for given string.

Read More
LINQ

Check list contains the values of another list

Here is an example about using a list as a filter for another list. Following example returns the items of list that occurs in the filter list by help of Language-Integrated Query (LINQ).

Read More
LINQ

Get All Indexes of an Item in an Array

Here is an example about finding all indexes of an item in an array. Enumarable.Range(0,length) provides us to loop 0 to length. We just compare the index numbers of items with our string (“BMW”) in that loop. This returns all index numbers of specified string in this array.

Read More
LINQ