how to search a string?

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello,

I want to be able to search for a keyword within a string to see if
exists how can I acomplish this? Thanks in advance.

string = "this is a string and I want to see if I can test for a key word
like er324"

I want to see if er324 is within the string.

John
 
* "John said:
I want to be able to search for a keyword within a string to see if
exists how can I acomplish this? Thanks in advance.

string = "this is a string and I want to see if I can test for a key word
like er324"

I want to see if er324 is within the string.

Use the string's 'IndexOf' method or the
'Microsoft.VisualBasic.Strings.InStr' function.
 
John said:
I want to be able to search for a keyword within a string to
see if
exists how can I acomplish this? Thanks in advance.

string = "this is a string and I want to see if I can test for a key
word like er324"

I want to see if er324 is within the string.

Use
yourstring.indexof("er324")
 
Hi John

If yourstring.indexof("er324") > - 1 then 'the index give the place of
"er324"
doItExist
Else
doIeExistNot
End if
 
Back
Top