name_value(String, Name, Value) :- sub_string(String, Before, _, After, "="), !, sub_atom(String, 0, Before, _, Name), sub_string(String, _, After, 0, Value).
The next example defines a predicate that inserts a value at a position. See sub_atom/5 for more examples.
string_insert(Str, Val, At, NewStr) :- sub_string(Str, 0, At, A1, S1), sub_string(Str, At, A1, _, S2), atomics_to_string([S1,Val,S2], NewStr).