Substrings

You can use the SUBSTR (substring) function to include a portion of a larger string of characters in a formula.

To calculate a substring, you must provide these references:

  • The segment from which you want to take the substring.

  • The starting position within the string where you want to begin referencing values.

  • The length of the string that you want to reference.

For example, if segment 10 is 400012, then these expressions are true:

Function

Description

SUBSTR(S10,1,4)

Indicates that the substring from segment 10 starts at the first position of the string and includes the next four positions. The substring value is 4000.

SUBSTR(S10,5,2)

Indicates that the substring from segment 10 starts at the fifth position of the string and includes the next two positions. The substring value is 12.