Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for string inside a string

Status
Not open for further replies.
Joined
Apr 11, 2002
Messages
193
Location
IN
Hi,

I want to check for a string inside a string and if it exists then return true else return false.
The string might be "Select Name" so i want to check if there is "Select" in the string then return true else false. I can hardcode the value in the if condition for the check.

Thanks,
Manish
 
Use: strWholeString.IndexOf(strSearchString)

If the Search String is found in the Whole String then IndexOf will return the Index of the first character.

Senior Software Developer
 
Hi,

I tried indexOf and it did work for me. Thanks.

Manish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top