Right trims a string. Same as String.trim, but only for the end of a string.
@param {String} s The string to operate on.
@param {String} [what='\\s+'] What to trim.
@return {String} The right trimmed string
function rtrim (s, what) {
                    what = typeof what === 'string' ? what : '\\s+';
                    return s.replace(new RegExp(what + '$'), '');
                }