STRIPTRAIL$
STRING, ASCII|CHARACTER
This function will remove all the trailing characters based on a supplied ASCII character value or a character.
Example
PRINT STRIPTRAIL$("AAABBBAAA", 65)
PRINT STRIPTRAIL$("AAABBBAAA", "A")
Output
AAABBB
AAABBB