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,
I want to be able to search for a keyword within a string to see if
exists how can I acomplish this?

String.IndexOf

or

InStr



Mattias
 
* "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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top