INSTRING

The INSTRING function returns a number that indicates the position of a substring in a string.

Function Name

INSTRING

Description

Returns a number that indicates the position of a substring in a string. The first character in the string corresponds to index 1, the second to index 2 and so on. If the substring is not present, 0 is returned.

Arguments

INSTRING('STRING', 'SUBSTRING')

Where:

  • String is the string expression in which to search
  • Substring is the string for which to search.

Both the STRING value and the SUBSTRING value has to be enclosed in single quotes.

For more information, see String

Returns

REAL.

The returned value is a number that indicates the starting position of the substring value within the string value.

Examples:

INSTRING('The quick brown fox', 'brown')

This will return 11 as 'brown' begins at the eleventh character from the left of the string.

INSTRING('The quick brown fox', 'jump')

This will return 0 (not found).


Disclaimer

ClearSCADA 2017 R3