LINQ OfType() MethodOfType() operator is used to return the element of the specific type, and another element will be ignored from the list/collection. Syntax of LINQ OfType() OperatorThe syntax of using the OfType () LINQ Operator is to get the specified type of elements from the list/collection is: C# Code In the above syntax, we are trying to get only the string elements from the collection of "obj" by using the OfType operator. Example of LINQ OfType () operatorHere is the example of the LINQ OfType() operator to get the only specified type of elements from the list/collection. In the above example, from "result" list, we are trying to get only those elements, which are the type of string. The last element is ignored because it is an integer. OUTPUT: Next TopicLINQ AsEnumerable Operator |