Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Does a List of T contain a value

$
0
0
Here is my code that I am working with:

Code:

        MsgBox(ListOfPackageContents.FindIndex(Function(item) item.Name = "Schedule"))
        MsgBox(ListOfPackageContents.Contains(Function(item) item.Name = "Schedule"))

ListOfPackageContents is a List(Of ZipArchiveEntry).

My first line of code works, but the second does not. May I have some help to find if an item exists in a List of T.

I can easily loop through the List, but am wondering how to do this with the above code style... btw, what is the above style of code, where functions can be used in a line of code?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>