$rsubstr(string,rbegin,rend) returns the substring of string starting at rbegin from the end of string and ending before rend from the end of string. If rend is omitted, it is omitted to the end of string. Both rbegin and rend are 0-based relative to the end of the string, from right to left. This function extracts the last n characters of a string.
The following example returns the last four characters of ${sku}. If the value of ${sku} is “FPB-6473”, it will return “6473”. $rsubstr() is useful for extracting the last n characters of a variable length field; for example, if the value of ${sku} is “ABCD-1234”, it will return “1234”.
$rsubstr(${sku},3)
The following example returns the value of ${part number} starting with the 7th character from the right, up to but excluding the 4th character from the right. If the value of ${part number} is “1234-567-001”, then it will return “567”.
$substr(${part number},6,3)
This is similar to $substr() except that the indices are relative to the end of string, from right to left.