I suggest checking out JMP Scripting Index (from JMP go to Help / Scripting Index) and https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/character-functions.shtml .
Right(string, count returns a substring of the right-most count characters of the string.
Substr(string, startIndex, count extracts the characters that are the portion of the first argument string. Begins at the position given by the second argument (startIndex), and ends based on the number of characters specified in the third argument (count). If start is negative, Substr searches backward from start from the end of the string. If length is negative or absent, Substr returns a string that begins with start and continues to the end of the text string.
-Jarmo