Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Find the index of the last occurrence of any character in the string is within another string

Imports System Class Sample    Public Shared Sub Main()       Dim str As String = "this is a test."       Dim start As Integer       Dim at As Integer       Dim target As String = "is"       Dim anyOf As Char() = target.ToCharArray()       at = str.LastIndexOfAny(anyOf)       If at > - 1 Then          Console.Write(at)       Else          Console.Write("(not found)")       End If    End Sub End Class