Update proplist erlang
erlang, list, tuples
Solution
You can use lists:keyreplace/4 function:
lists:keyreplace(b, 1, L, {b, New_B_Value}).
lists:keyreplace(d, 1, L, {d, New_D_Value}).
Problem
My first question is, can we update a proplist or a tuple of a proplist? If so, I have to replace a tuple value of a proplist: Assume L, ``` L = [{a, A}, {b, B}, {c, C}, {d, D}, {e, E} ...] ``` I want to replace a tuple `{b, B}` with a new Tuple `{b, New_B_Value}` and same with tuple `d` to get `{d, New_D_Value}`. So the output should be something like this: ``` L = [{a, A}, {b, New_B_Value}, {c, C}, {d, D}, {d, New_D_Value} ...] ``` Thanks in advance!