Trims whitespace from the end of a string.
input string
trimmed string
var out = rtrim( ' Whitespace ' ); // returns ' Whitespace'
var out = rtrim( '\t\t\tTabs\t\t\t' ); // returns '\t\t\tTabs'
var out = rtrim( '\n\n\nNew Lines\n\n\n' ); // returns '\n\n\nNew Lines'
Trims whitespace from the end of a string.