1 01/04/85  reverse_substr, rvsubstr
 2 
 3 Syntax as a command:  rvsubstr STR I {N}
 4 
 5 
 6 Syntax as an active function:  [rvsubstr STR I {N}]
 7 
 8 
 9 Function:  performs the same function as the substr command/active
10 function, but counts characters from right to left.  The returned
11 string has its characters in the same order as the input string.
12 
13 
14 Notes:  The active function returns that portion of STR starting with
15 the character in position I (the characters in the string being numbered
16 from right to left starting with one) and continuing for N characters
17 (where I and N are decimal integers; I must be greater than zero and N
18 must be greater than or equal to zero).  If N is omitted, the remained
19 of STR is returned.  If I is greater than the length of STR, the null
20 string is returned.  If N is greater than the remainder of STR, the
21 remainder is returned.
22 
23    [reverse_substr STR I {N}]
24 is the same as--
25    [reverse [substr [reverse STR] I {N}]]
26 
27 
28 Examples:
29 (! marks user input)
30 
31  ! reverse_substr abcdefg 2 3
32    def
33  ! reverse_substr frobozz 4
34    frob
35  ! reverse_substr spatula 5 4
36    spa