replacing only exact matches in script
hh at hyperhh.de
Wed Aug 7 17:32:31 EDT 2019
> Richard H. wrote:
> I need to replace only exact true words, though.
> So I need to be able to take an input string such as
> 5*pay - 2*monthlypay
> and be able to replace “pay" with
> without replacing monthlypay.
You could try the following (works for me).
Put a three-char string that's not in inString into X, e.g.
put "yap" into X
repeat for each line L in inString
repeat while \
put X into char p3 to p4 of L -- replaces pay
put cr & L after outString
replace X with "getVal(pay,,,debtor)" in outString
This finds case-insensitive exactly the trueWord "pay".
More information about the Use-livecode