wsyeager
Well-known member
Im using the new TextFieldParser class and want to find out how to use the "Find" method of the Array object after I parse multiple fields of a line into a string array.
Here is the code:
The "AddressOf ProductGT11" inside the ParseData2 sub is giving me a compile time error:
Method Private Shared Function ProductGT11(p() as string) as Boolean does not have the same signature as delegate Delegate Function Predicate(Of T)(obj as String) As Boolean
How can I correct his?
Here is the code:
Code:
Private Sub ParseData2()
Dim fields As String()
Dim parser As New TextFieldParser("c:\epp\test.txt")
Try
parser.SetDelimiters(";")
parser.TrimWhiteSpace = True
While Not parser.EndOfData
Read in the fields for the current line
fields = parser.ReadFields()
Dim str As String = Array.Find(fields, AddressOf ProductGT11)
End While
Catch ex As Exception
Throw ex
End Try
End Sub
Private Shared Function ProductGT11(ByVal p As String()) As Boolean
code here will do the find
End Function
The "AddressOf ProductGT11" inside the ParseData2 sub is giving me a compile time error:
Method Private Shared Function ProductGT11(p() as string) as Boolean does not have the same signature as delegate Delegate Function Predicate(Of T)(obj as String) As Boolean
How can I correct his?
Last edited by a moderator: