Right$

right$ extracts a substring of a string starting from a given position (the right side).

Syntax

 right$(EXPR_STRING,EXPR_POS)

Examples

 # Extraction of the letters starting from 12th position of the latin alphabetALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"AFTER_TWELVE=right$(ALPHABET, 12) : # Returns "LMNOPQRSTUVWXYZ"# Computes the length of a string# It would be preferable to use len!!!STRING_LEN = 0While right$(MY_STRING,STRING_LEN+1) <> "" : STRING_LEN+=1 : Wend# Extracts the character from a string starting at position 32# the result string will become an empty string if its original length was smaller than 32MY_STRING=right$(MY_STRING,32)# Extracts the characters from a clob starting at position 800# the clob will become an empty string if its original length was smaller than 800MY_CLOB=right$(MY_CLOB,800)

Description

The function right$ extracts the characters of a string, starting at EXPR_POS position. Based on the length of the result, the type of the result is Char or Clbfile.

Comments

Associated errors

Error codeDescription
10The first argument is not a string, or the second argument is not numeric.
50The second argument is negative.

See also

mid$, left$, seg$, len.