Maf Kazama Maf Kazama - 1 month ago 4x Question

How to count value in array with exception?

I have an array that having integer value,

Dim array1() As Integer = New Integer() {14,12,0,4,25,0}

I would like to count except zero number, hope the result is
. I was try to find the article in the internet but almost isn't exception.


I used a Lambda Expression and .FindAll:

    Dim array1() As Integer = New Integer() {14, 12, 0, 4, 25, 0}
    Dim matchedItems() As Integer = Array.FindAll(array1, _
                                        Function(x) x > 0)

It will find all items within the array where the item is > 0.