LastIndexOfAny to find first occurrence of character in array : String Search « Data Types « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Data Types » String SearchScreenshots 
LastIndexOfAny to find first occurrence of character in array
LastIndexOfAny to find first occurrence of character in array
   
Imports System

Public Class MainClass

   Shared Sub Main()
      Dim letters As String = "abcdefghijklmabcdefghijklm"
      Dim searchLetters As Char() = New Char() {"c"c, "a"c, "$"c}

      Console.WriteLine("LastIndexOfAny to find first occurrence of character in array")
      Console.WriteLine("Last occurrence of ""c""," & _
         " ""a"" or ""$"" is located at " & _
         letters.LastIndexOfAny(searchLetters))

      Console.WriteLine("Last occurrence of ""c"", ""a"" or " & _
         """$"" is located at " & _
         letters.LastIndexOfAny(searchLetters, 1))

      Console.WriteLine("Last occurrence of ""c"", ""a"" or " & _
         """$"" is located at " & _
         letters.LastIndexOfAny(searchLetters, 255))

   End Sub ' Main

End Class


           
         
    
    
  
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.String IndexOf and InsertString IndexOf and Insert
8.String: Substring, LastIndexOfString: Substring, LastIndexOf
9.String IndexOf and Insert at a positionString IndexOf and Insert at a position
10.Sample for String.LastIndexOfAny(Char[])
11.Search string with IndexOf
12.String.LastIndexOfAny Method (Char[])
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.