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!

Quick question: substring count

Status
Not open for further replies.

IRABYY

Programmer
Apr 18, 2002
221
US
Fellows, quick question:

is there in VFP 7.0 some "native" function which counts the number of occurences of one string in another string?

WAW, say, I need to count how many THs are in the ALPHA BETHA THETHA KSI, for instance?

AHWBGA

Regards,

Ilya
 
Sure, OCCURS().
Code:
xx = "ALPHA BETHA THETHA KSI"
?OCCURS("TH", xx)
Should print 3.

Rick
 
rgbean (Programmer)
Sure, OCCURS().


I'll be damned!

I was searching the help on "str" and "count"! Something in the back of my mind told me I have seen it somewhere, but I could not recall...[ponder]

Thank you, Rick, very much! [2thumbsup]

Issue is solved, case is closed.

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top