How to use the LIKE searching for List in LINQ?

Steven Young 261 Reputation points

I want to use the LIKE to match the file extension name in the LINQ, e.g ~. .
The IncludedExts is a List Type.

But the line below is not right.
.Where((Function(n) IncludedExts.Any(AddressOf n.Name Like))

The line below is OK
.Where((Function(n) IncludedExts.Any(AddressOf n.Name Contains))

How to use the LIKE? thank you.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,084 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 106.4K Reputation points

    Try this:

    ā€ƒ.Where(Function(n) IncludedExts.Any(Function(x) n.Name Like x))

    0 comments No comments