Module Module1
Sub Main()
Dim s() As String = {"PHP", "C", "C++", "C#", "Java", "JavaScript",
"VB.NET", "VB6", "Pascal", "Python"}
Console.WriteLine("Array.FindIndex(s, AddressOf StartWithC): {0}",
Array.FindIndex(s, AddressOf StartWithC))
End Sub
Private Function StartWithC(ByVal s As String) As Boolean
If (s.Substring(0, 1).ToLower() = "c") Then
Return True
Else
Return False
End If
End Function
End Module
' run:
'
' Array.FindIndex(s, AddressOf StartWithC): 1