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

StrRight

Use this function to extract the rightmost character or characters from a symbol or character string. You may find the StrRight function useful for finding individual values from a combined value.

For example, suppose a complete account number in your system appears in the format A11234—consisting of a prefix code (A), followed by two digits (11) representing an entity code, followed by three digits (234) representing an account code.

You can use the StrRight function to find the account code (the three rightmost characters) from the complete account number.

Copy

Syntax

STRRIGHT (SymName[Structure] | "String",NumChars)         

where:

  • SymName is the name of a symbol.
  • Structure is a range of symbols.

    Note: To specify a range of symbols, enter the first and last symbols in the range, separated by a colon. For example, A0601:A0612.

  • String is a character string enclosed in double quotation marks.
  • NumChars is a positive integer representing the number of characters to extract from the end of the character string. NumChars cannot be greater than the number of characters in the character string.
Copy

Syntax example

STRRIGHT (AcctCode,"A11234",3)            
Copy

Example

CREATE VARIABLE StrTemp1 AS STRING
Variable = STRRIGHT ("SourceString",Number)
SET VARIABLE StrTemp1 = STRRIGHT ("StringTest",4)
 
StrTemp1 will equal "Test" (without the double quotation marks)        

Published:

StrRight

Use this function to extract the rightmost character or characters from a symbol or character string. You may find the StrRight function useful for finding individual values from a combined value.

For example, suppose a complete account number in your system appears in the format A11234—consisting of a prefix code (A), followed by two digits (11) representing an entity code, followed by three digits (234) representing an account code.

You can use the StrRight function to find the account code (the three rightmost characters) from the complete account number.

Copy

Syntax

STRRIGHT (SymName[Structure] | "String",NumChars)         

where:

  • SymName is the name of a symbol.
  • Structure is a range of symbols.

    Note: To specify a range of symbols, enter the first and last symbols in the range, separated by a colon. For example, A0601:A0612.

  • String is a character string enclosed in double quotation marks.
  • NumChars is a positive integer representing the number of characters to extract from the end of the character string. NumChars cannot be greater than the number of characters in the character string.
Copy

Syntax example

STRRIGHT (AcctCode,"A11234",3)            
Copy

Example

CREATE VARIABLE StrTemp1 AS STRING
Variable = STRRIGHT ("SourceString",Number)
SET VARIABLE StrTemp1 = STRRIGHT ("StringTest",4)
 
StrTemp1 will equal "Test" (without the double quotation marks)        

For an optimal Community experience, Please view on Desktop