Reading in multiple words for prolog
Posted
by prolog123456789
on Stack Overflow
See other posts from Stack Overflow
or by prolog123456789
Published on 2010-02-10T12:44:31Z
Indexed on
2010/06/13
10:02 UTC
Read the original article
Hit count: 150
Im running prolog via poplog on unix and was wondering if there was a way to read in multiple words (such as encase it into a string). For instance, read(X) will only allow X to be 1 term. However, if I encase the user input with "", it will return a list of character codes, is this the correct method as I can not find a way to convert it back to a readable string.
I would also like to be able to see if the multiworded string contains a set value (for instance, if it contains "i have been") and am unsure of how i will be able to do this as well.
© Stack Overflow or respective owner