Did vb6 years ago. Trying to upgrade brain to VB.NET
Private Sub BtnFindAll_Click(sender As Object, e As EventArgs) Handles BtnFindAll.Click
Dim AutosArray() As String = {"Chrysler", "Corvette", "Lincoln", "Buick", "Ford", "Fiat", "Chevrolet", "Mercury"}
Dim BooBee() As String
' The below line gets the error...
BooBee = System.Array.FindAll(AutosArray, AddressOf MatchFunction)
' The below line gets the same error...
'Dim BooBee() As String = Array.FindAll(AutosArray, AddressOf MatchFunction)
End Sub
Private Function MatchFunction(ByVal strAuto As String) As String
If strAuto.IndexOf("c") > 1 Then
Return strAuto
End If
End Function
When I click on BtnFindAll I get the below error message:
Exception Unhandled System.InvalidCastException: 'Conversion from string "" to type 'Boolean' is not valid.'
Inner Exception FormatException: Input string was not in a correct format.