s5h
10 years agoContributor
Aqstring.find cannot find the string
So I am using Aqstring.Find to find a substring of a string. My 2 strings are
strcomp ="currdaybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms1monthsoverdue2monthsoverdue3monthsoverdue4+monthsoverdue"
ss = "daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms"
When I do aqstring.Find(strcomp, ss, 0, false) it returns -1
The ss is an item from an array and strcomp is read from an excel. I converted both to string using aqconvert and checked using GetVarType and the both returned 8 so they are both strings.
When I evaluate the expression in TestComplete using the Ctrl and F12:
aqsting.find(strcomp, ss) = -1
aqstring.find(strcomp, "daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms") = 4
So it seems to be a problem with ss?
strcomp ="currdaybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms1monthsoverdue2monthsoverdue3monthsoverdue4+monthsoverdue"
ss = "daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms"
When I do aqstring.Find(strcomp, ss, 0, false) it returns -1
The ss is an item from an array and strcomp is read from an excel. I converted both to string using aqconvert and checked using GetVarType and the both returned 8 so they are both strings.
When I evaluate the expression in TestComplete using the Ctrl and F12:
aqsting.find(strcomp, ss) = -1
aqstring.find(strcomp, "daybookvoucherinvoicedateduedateropenamount(tc)openamount(bc)withinterms") = 4
So it seems to be a problem with ss?