Array.LastIndexOf(T) searches for the specified object and returns the index of the last occurrence
Imports System
Public Class Example
Public Shared Sub Main()
Dim numbers() As String = { "One","Two","Three","XXX","Four","One","Five" }
For Each num As String In numbers
Console.WriteLine(num)
Next
Console.WriteLine(Array.LastIndexOf(numbers, "One"))
Console.WriteLine(Array.LastIndexOf(numbers, "One", 3))
Console.WriteLine(Array.LastIndexOf(numbers, "One", 4, 4))
End Sub
End Class
Related examples in the same category