list from a string

Ulf Wiger ulf.wiger@REDACTED
Sun Feb 15 22:52:06 CET 2004


Erlang (BEAM) emulator version 5.3 [threads:0]

Eshell V5.3  (abort with ^G)
1> String = "[a,b,c]".
"[a,b,c]"
2> {ok,Tokens,_Line} = erl_scan:string(String ++ ".").
{ok,[{'[',1},{atom,1,a},{',',1},{atom,1,b},{',',1},{atom,1,c},{']',1},{dot,1}],
     1}
3> erl_parse:parse_term(Tokens).
{ok,[a,b,c]}
4>

On Sun, 15 Feb 2004 22:26:59 +0100, Robert Balogh <baloghrobi@REDACTED> 
wrote:

> Hej,
>
> Is it possible to get the list form this string?
> This is the string: "[a,b,c]"
> and I'd like to get back this list [a,b,c]
>
> thank you for your help,
> regards,
> /Robi
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online 
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>



-- 
Ulf Wiger




More information about the erlang-questions mailing list