Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Saturday, 5 January 2019

Difference between Instr and InstrRev

InStrRev:

The InStrRev Function returns the first occurrence of one string within another string. The Search happens from right to Left.

Syntax:

InStrRev(string1,string2[,start[,compare]])

Example:
 str = "abcdeabcde"

MsgBoxInStrrev(str, "e")   ' search from end, , will return 10


InStr:

The InStr Function returns the first occurrence of one string within another string. The search happens from left to right.

Syntax:

InStr([start,]string1,string2[,compare])


Example:

 str = "abcdeabcde"

MsgBoxInStr(str, "e") ' search from start, will return 5



No comments:

Post a Comment

Note: only a member of this blog may post a comment.