Reputation: 203
I'm a little bit confused. I would like to use the split_string function which can be seen here. But I just don't know how to import or use this function. Do I have this pl File already on my PC? I can only find strings.pl in C:\Program Files\swipl\library\dialect\ciao but I doesn't include the split_string function.
I'm pretty sure it's totally easy but I just can't figure it out.
Thanks!
Upvotes: 0
Views: 198
Reputation:
You will probably need to install the "development release" of SWI-Prolog (major version 7), if you haven't yet. On Windows and MacOS, this simply means getting the right binaries. For Linux, you can either add the PPA (on the same page), or build from source, which is straight-forward enough.
Then, you will get something along the lines of: (note the banner with the version number)
$ swipl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.1.25)
Copyright (c) 1990-2014 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- split_string("a.b.c", ".", "", L).
L = ["a", "b", "c"].
You shouldn't need to import anything explicitly.
Does that solve your problem?
Upvotes: 3