Searching in array: Visual Basic 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rashido
    New Member
    • Mar 2007
    • 1

    #1

    Searching in array: Visual Basic 2005

    Hi all, would like to check whether there is a built-in function in Visual Basic Studio 2005 that can search through the contents of an array and return the index?

    Currently, I'm using a 'for loop' to search through the items in the array one by one and it is rather slow. I'm doing a vigenere cipher program which takes in a text file containing encrypted text and is able to guess the keyword which was used during encryption. The code works but for each letter in the paragraph, it loops for 26 times to find the matching alphabet.

    Please advice. Thanks.
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by rashido
    Hi all, would like to check whether there is a built-in function in Visual Basic Studio 2005 that can search through the contents of an array and return the index?

    Currently, I'm using a 'for loop' to search through the items in the array one by one and it is rather slow. I'm doing a vigenere cipher program which takes in a text file containing encrypted text and is able to guess the keyword which was used during encryption. The code works but for each letter in the paragraph, it loops for 26 times to find the matching alphabet.

    Please advice. Thanks.
    use collection insted of array
    and its contains property will help u to do so

    Comment

    Working...