INSTR_RIGHT()

INSTR_RIGHT(S1,S2)

RETURNS THE POSITION IN S1 OF THE LAST CHARACTER OF S2 COUNTING FROM BACK TO FRONT, IF THE STRING S1 CONTAINS THE STRING S2

  • Type: Function
  • Parameters: 2
  • Group: Strings

ACTION

The function INSTR_RIGHT(S1,S2) returns the position in S1 of the last character of S2, scanning S1 from back to front, if the string S1 contains the string S2, and otherwise returns 0.

SYNTAX: Result=INSTR_RIGHT(S1,S2)

  • S1 = string expression.
  • S2 = string expression.

USE

  • The function INSTR_RIGHT() is used to know the position of a string in another string, scanning from back to end.

ERROR

  • If S1 is not a correct string expression.
  • If S2 is not a correct string expression.

EXAMPLE

dim a$,b$

a$="panoramic"

b$="ram"

print instr_right(a$,b$)

print 3

SEE ALSO

INSTR()

INSTR_LAST()

INSTR_POS()