to_string(+term)

This string predicate converts an expression to a string. The predicate can only be used in a string expression.

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

Examples
A=12, X is_string to_string(A). variable X is assigned the string "12"

 

Exceptions
The parameter is an empty variable a type_error(evaluable, PredicateIndicator) exception is thrown

 

 

info@trinc-prolog.com