The string String is split at the separators, and any padding characters around the resulting sub-strings are removed. Neither the separators nor the padding characters occur in SubStrings.
Characters that occur both in SepChars and PadChars are considered separators, but such that a sequence of them is considered to be only one separator. Moreover, when they occur at the beginning or end of the string, they are ignored, ie. treated like padding.
The predicate can also be used to trim leading and trailing padding from a string by giving an empty separator string.
% split at every / [eclipse]: split_string("/usr/local/eclipse", "/", "", L). L = ["", "usr", "local", "eclipse"] yes. % split at every sequence of / [eclipse]: split_string("/usr/local//eclipse/", "/", "/", L). L = ["usr", "local", "eclipse"] yes. % split and strip padding [eclipse 4]: split_string(" comma, separated , data items ", ",", " \t", L). L = ["comma", "separated", "data items"] yes. % just strip padding [eclipse]: split_string(" Hello world...", "", " .", L). L = ["Hello world"] yes.