This predicate is functionally equivalent to sub_atom/5,
but operates on strings. Note that this implies the string input
arguments can be either strings or atoms. If SubString is
unbound (output) it is unified with a string. The following example
splits a string of the form
<name>=<value> into the name part (an
atom) and the value (a string).
name_value(String, Name, Value) :-
sub_string(String, Before, _, After, "="),
!,
sub_atom(String, 0, Before, _, Name),
sub_string(String, _, After, 0, Value).