[erlang-questions] how: Another library flatten function?

Bengt Kleberg <>
Fri Feb 26 16:23:00 CET 2010


Easily change them, no. I would have to go over the list of lists and
change them. But this is the best suggestion so far.


bengt

On Fri, 2010-02-26 at 15:27 +0100, Robert Raschke wrote:
> 
> On Fri, Feb 26, 2010 at 1:58 PM, Bengt Kleberg
> <> wrote:
>         Greetings,
>         
>         I have the following list:
>         ["asd",[["Flow","kalle"]],["Sub","F"]]
>         I would like to flatten it to:
>         ["asd","Flow","kalle","Sub","F"]
>         lists:flatten/1 is too effective. It gives me:
>         "asdFlowkalleSubF"
>         
>         Is there another flatten somewhere?
>         
> 
> I take it you couldn't easily change your strings to be binaries? 
> 
> 1>
> lists:flatten([<<"asd">>,[[<<"Flow">>,<<"kalle">>]],[<<"Sub">>,<<"F">>]]).
> [<<"asd">>,<<"Flow">>,<<"kalle">>,<<"Sub">>,<<"F">>]
> 
> 
> Robby
> 
> 



More information about the erlang-questions mailing list