[erlang-questions] list:join() for erlang?
Wed Sep 12 18:56:02 CEST 2007
i'm guessing they mean join in the scripting language sense which is more
for creating CSV type strings.
ie (fictional function):
"I,Like,Erlang" = lists:join(["I","Like","Erlang"],",")
so join/2 would be something like (newbie alert, just started learning
erlang, so excuse the (possibly) bad code):
lists:flatten( [First] ++ [ JoinWith ++ X || X <- Rest] ).
would result in "A+B+C"
On 9/12/07, igwan <igwan@REDACTED> wrote:
> It does exist :
> and the corresponding syntactic sugar :
> 1> [a,b,c] ++ [d,e,f].
> Peter K Chan a écrit :
> > I looked around and I couldn't find a list:join() implementation for
> > erlang. Is this intentional? The join function seems to be a useful
> > feature to have.
> > I ended up writing my own version, which was simple enough; but it would
> > be even better if it is available as a BIF.
> > Peter
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions