I'm running a Scan against a table where I'm pulling the description (memo) into a variable and performing a string replace.
lcDescr is a product description of approx 200 words
lcLookForProd is a numeric product ID
lcLinkProductID is a numeric product ID
lcReplaceProdWith is shown below
lcReplaceProdWith = 'Product #<a href="/' + ALLTRIM(purl.keyword) + '">' + lcLinkProductID + '</a>'
STRTRAN(lcDescr, lcLookForProd, lcReplaceProdWith) && make text replacement in description
This works great except my final result is:
Product #<a href="/Speakers">26810</a>
which results in Product #2681026810
How to fix this?
(the product numbers vary in length and may have a space, comma, period or < directly after.