Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

SubStr

Use this function to extract part of a string.

Copy

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.
Copy

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)

Published:

SubStr

Use this function to extract part of a string.

Copy

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.
Copy

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)

For an optimal Community experience, Please view on Desktop