STREXTRACT()

S

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

Archives