fields/4

fields(+ Line,+ Separators,- Split)*

Unify Words with a set of strings obtained from Line by using the character codes in Separators as separators for fields. If two separators occur in a row, the field is considered empty. As an example, consider:


 ?- fields( "Hello I am free" , " *" ,S).

 S = [ "Hello" , "" , "I" , "am" , "" , "free" ] ?