trimr( +term )

This built-in string predicate removes the trailing whitespace characters from the argument string. To remove the leading and trailing whitespaces use trim/1 and to remove leading whitespaces there is the predicate triml/1.

see also: &/2 delete/3 expand_sq/1insert/3 is/2 substring/3 string_list/2 to_lower/1 to_string/2 to_upper/1  trim/1 triml/1 working with strings

Examples
X is_string trimr('  abcd   '). variable X is unified with the string '  abcd'
X is_string trimr(' a b f '). variable X is unified with the string ' a b f'

 

Exceptions
The parameter is an empty variable an instantiation_error exception is thrown

 

 

info@trinc-prolog.com