Forum Discussion

JBSoccerbrit's avatar
JBSoccerbrit
Contributor
10 years ago

Validate String for specific character in a specific position.

Using a keyword test how would you validate that the 10th position of a string is of a specific character, for example.

TxStatus=0&OrderId=100121&CardType=MC&CardSuffix=5454&ApprovalCode=198538

- I would like to assure that the TxStatus= is returning a 0 (the 10th position of the string). 

I've looked at aqStringLength and aqStringLength.Get but I am not seeing a way to use these to validate the result.

Thanks,

  • JBSoccerbrit's avatar
    JBSoccerbrit
    10 years ago

    We managed to resolve this by assigning a variable value like so.

    aqString.GetChar(Aliases.browser.wndSOURCE_VIEWER.page32770.RICHEDIT50W.wText,9)

    Then doing an IF Then to pull the result of the 9th position in the variable. 

  • cunderw's avatar
    cunderw
    Community Hero

    What you want is aqString.GetChar(s,10) where 's' is the string and '10' is the position.