[ Strings and Atoms | Reference Manual | Alphabetic Index ]

append_strings(?String1, ?String2, ?String3)

Succeeds if String3 is the concatenation of String1 and String2.
String1
String or variable.
String2
String or variable.
String3
String or variable.

Description

Succeeds if String3 is the concatenation of String1 and String2.

Used to find all possible solutions for the concatenation of String1 and String2 to make String3.

Note that if String1 and String2 are instantiated, it is more efficient to use the predicate concat_strings/3.

Modes and Determinism

Exceptions

(5) type error
One (or more) of the arguments is instantiated, but not to a string.
(4) instantiation fault
String3 and at least one other argument are uninstantiated.

Examples

Success:
      append_strings("a",B,"abc"). (gives B = "bc").
      append_strings(A,B,"a").     (gives A=""  B="a";
                                          A="a" B="").
Fail:
      append_strings("a","b","abc").
Error:
      append_strings(A,"bc",C).        (Error 4).
      append_strings(5,B,C).           (Error 5).
      append_strings(A,'me',"meme").   (Error 5).



See Also

concat_strings / 3, concat_string / 2, join_string / 3, sprintf / 3