HLRosenberger
asked on
Help with FindIndex method; using predicate.
I have this bit of code, below, that finds the index of the first TextElement in eles that contains the dataValue. I want to modify it so I can pass a count and find the Nth occurrence of dataValue.
Thanks
Dim eles As New List(Of TextElement)
dim dataValue as string = 'george washington'
index = eles.FindIndex(Function(da taValue As TextElement)
Return dataValue.value = dataValue
End Function)
Private Class TextElement
Public value As String
Public element As XElement
End Class
Thanks
Dim eles As New List(Of TextElement)
dim dataValue as string = 'george washington'
index = eles.FindIndex(Function(da
Return dataValue.value = dataValue
End Function)
Private Class TextElement
Public value As String
Public element As XElement
End Class
ASKER
I understand that I should change that variable name. However, how does changing that variable name make is so that I can find the Nth occurrence of data?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
Not a problem HLRosenberger, glad to help.
Try it like this.
Open in new window