Removes all the trailing occurrences of a character from a string.
String to trim
String to remove
Trimmed string
Removes all the trailing occurrences of a character from a string.