chris vamvalis
chris vamvalis

Reputation: 37

How to convert a string to a single-element list?

I am new to prolog and I would like to convert a string: 'test string' to an array with a single element: ['test string'] so I can append it to an existing list.

Upvotes: 0

Views: 97

Answers (1)

David Tonhofer
David Tonhofer

Reputation: 15316

Just write it as is:

X='test string'.
List=[X].

Upvotes: 1

Related Questions