例如: "[{a},1]" => [{a},1]
string_to_term(String) ->
case erl_scan:string(String++".") of
{ok, Tokens, _} ->
case erl_parse:parse_term(Tokens) of
{ok, Term} -> Term;
_Err -> undefined
end;
_Error ->
undefined
end.
erlang的term反序列化,string转换为term
最新推荐文章于 2022-07-31 23:36:38 发布