I’m almost too embarassed to mention this…

I found a VFP function STREXTRACT() for extracting text from a string.

Yep, I have the following code all over the place:

nStart = AT(‘Starting text’, cString)

nEnd = AT(‘End text’, cString)

cSubString = SUBSTR(cString, nStart, nEnd – nStart)

which can now be replaced with:

cSubString = STREXTRACT(cString, ‘Starting text’, ‘End text’)

Add comment

About Craig

I'm the co-host of HubShots and the CEO of XEN - helping mid-large B2B companies with their digital marketing and lead generation.

Craig Bailey