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!

In string function? 2

Status
Not open for further replies.

DugzDMan

Programmer
Oct 19, 2000
157
US
Is there an In string type function in CF. In VB there is the InStr(String A, String B) function which searchs String A for the presence of String B. If it is found, it returns the position where String B starts in String A. If it isn't found, it returns 0.

I'm looking for something similar in CF.

Example: If I'm looking for Houston:
Code:
My values:       Returns
Dallas           False
Houston          True
Dallas, Houston  True
Anything like that (or something similar that I can check for)?

Thanks!
 
Check out the functions:
Find() and FindNoCase()

Example:

Find("Houston","Dallas, Houston",1) will return 9.

The FindNoCase() function ignores case.
 
Yes... it's
Code:
Find()
or
Code:
FindNoCase()
. There are also RegEx versions
Code:
REFind()
or
Code:
REFindNoCase()
respectively, that let you find regular expressions rather than strings.



-Carl
 
Thanks you guys! That should work just fine, I'll have to check when I get back into work.
 
Yep, I checked it out and this works. Thanks guys!!! That's a star for each :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top