Skip to main content

SubStr

Use this function to extract part of a string.

Syntax:

SUBSTR (SymName|"String", StartChar, NumChars)

where:

  • SymName is the name of a symbol.
  • String is a character string enclosed in double quotation marks.
  • StartChar is the first character of the string that you would like to extract.
  • NumChars is the number of characters that you would like to extract.

Code example:

CREATE VARIABLE StrTemp1 AS STRINGVariable = SUBSTR ("SourceString",StartNum,Length)SET VARIABLE StrTemp1 = SUBSTR ("StringTest",2,4)

// StrTemp1 will equal "trin" (without the double quotation marks)

Was this article helpful?

We're sorry to hear that.