[ Strings and Atoms | Reference Manual | Alphabetic Index ]

atomics_to_string(++List, -Dest)

Succeeds if Dest is the concatenation of the atomic terms contained in List.
List
List of atomic terms.
Dest
String or variable.

Description

Dest is unified with the concatenation of the atomic terms contained in List. List may contain numbers, atoms and strings. The result of the concatenation is always a string.

Modes and Determinism

Exceptions

(4) instantiation fault
List is not instantiated (non-coroutine mode only).
(4) instantiation fault
List contains free variables (non-coroutine mode only).
(5) type error
List is instantiated, but not to a list of atomic terms.
(5) type error
Dest is neither an string nor a variable.

Examples

Success:
      atomics_to_string([abc,def],"abcdef").

      atomics_to_string(["Str1","Str2"],X).
                             X = "Str1Str2".

      atomics_to_string([the,man," is aged ",20],X).
                             X = "theman is aged 20".

      atomics_to_string([1,2,3],X).
                             X = "123".

Fail:
      atomics_to_string([ab,bc],"abc").

Error:
      atomics_to_string(A,X).        (Error 4).
      atomics_to_string([abc,D],X).  (Error 4).
      atomics_to_string(art,X).      (Error 5).

See Also

atomics_to_string / 3, concat_atom / 2, concat_strings / 3, append_strings / 3, atom_string / 2, split_string / 4, sprintf / 3