String.LastIndexOfAny Method (Char[]) : String Search « Data Types « VB.Net






String.LastIndexOfAny Method (Char[])

  
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()

      start = str.Length - 1

      at = str.LastIndexOfAny(anyOf)
      If at > - 1 Then
         Console.Write(at)
      Else
         Console.Write("(not found)")
      End If
      Console.Write("{0}{0}{0}", Environment.NewLine)
   End Sub 'Main
End Class 'Sample

   
    
  








Related examples in the same category

1.Combine Insert and IndexOfCombine Insert and IndexOf
2.Using String searching methods: IndexOfUsing String searching methods: IndexOf
3.LastIndexOf to find a character in a stringLastIndexOf to find a character in a string
4.IndexOf to locate a substring in a stringIndexOf to locate a substring in a string
5.LastIndexOf to find a substring in a stringLastIndexOf to find a substring in a string
6.IndexOfAny to find first occurrence of character in arrayIndexOfAny to find first occurrence of character in array
7.LastIndexOfAny to find first occurrence of character in arrayLastIndexOfAny to find first occurrence of character in array
8.String IndexOf and InsertString IndexOf and Insert
9.String: Substring, LastIndexOfString: Substring, LastIndexOf
10.String IndexOf and Insert at a positionString IndexOf and Insert at a position
11.Sample for String.LastIndexOfAny(Char[])
12.Search string with IndexOf