Standard LibraryTypesstringMethodsrtrimOn this pagertrim Method of string. rtrim() -> Object Removes whitespace from the end of a string. Returns A right-trimmed string. Example var value = "bob "value.rtrim() + "|"//-> bob|