Skip to content

Instantly share code, notes, and snippets.

@pichi
Forked from darkua/proplists_get_value
Created May 16, 2010 11:21
Show Gist options
  • Save pichi/402828 to your computer and use it in GitHub Desktop.
Save pichi/402828 to your computer and use it in GitHub Desktop.
proplists_get_value(Key, List)->
case lists:keyfind(Key,1,List) of
{K,V} when K =:= Key ->
V;
_->
proplists_get_value_(Key, List)
end.
proplists_get_value_(_,[])->
undefined;
proplists_get_value_(Key,[Key|Tail]) ->
true;
proplists_get_value_(Key,[_|Tail]) ->
proplists_get_value_(Key,Tail).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment