Command Reference : Function Reference : Function Reference: R
  
 
@right
Right substring of string.
Syntax: @right(str, n)
str: string, alpha, svector
n: integer, series, vector
Return: string, alpha, svector
Returns a string containing n characters from the right end of str. If the source is shorter than n, the entire string is returned.
Examples
The commands
string orig = "I doubt it"
string sc1 = @right("I doubt it", 8)
string sc2 = @left(orig, 8)
return the string objects SC1 and SC2 containing the string “doubt it”.
If ALPHA1 is an alpha series,
alpha strleft = @right(alpha1, 7)
returns the right-most 7 characters from the string values of ALPHA1 for each observation in the workfile sample.
If SVEC1 is an string vector,
svector strleft = @right(svec1, 12)
returns an svector containing 12 characters from the right end of each element of SVEC1.
Cross-references
See also @wright, @left, @wleft, @mid, and @wmid.