RInStr

Position = RInStr ( String AS String , Substring AS String [ , Start AS Integer , Comparison AS Integer ] )

Returns the position of the last occurrence of Substring in String from right to left.

Start specifies where to start the search:
  • If Start is omitted, or if Start is 0, the search begins at the end of the string.

  • If Start is > 0, the search begins at the position Start.

  • If Start is < 0, the search begins at the position (- Start) from the end of the string.

Comparison can be one of the following value: If the substring is not found, this function returns zero.

Examples

PRINT RInStr("Gambas is basic", "bas")
11

PRINT RInStr("Gambas is basic", "bas", 10)
4

PRINT RInStr("Gambas is basic", "not")
0

See also