[erlang-questions] list:join() for erlang?

igwan igwan@REDACTED
Wed Sep 12 18:32:45 CEST 2007


If you're working with filenames, there exists filename:join/1
I don't know of a function in OTP that takes an arbitrary separator though.

igwan

Peter K Chan a écrit :
> Sorry that I made an omission.
>
> I was referring to the variant of join which takes a separator. For example: lists:join("abc", "/"), which evaluates to "a/b/c".
>
> Do you know if something like this exists in the distribution?
>
> Peter
>
> -----Original Message-----
> From: igwan [mailto:igwan@REDACTED] 
> Sent: Wednesday, September 12, 2007 11:19 AM
> To: Peter K Chan
> Cc: erlang-questions@REDACTED
> Subject: Re: [erlang-questions] list:join() for erlang?
>
> It does exist :
>
> erlang:'++'/2
>
> and the corresponding syntactic sugar :
>
> 1> [a,b,c] ++ [d,e,f].
> [a,b,c,d,e,f]
>
>
> -igwan
>
> 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
>>   
>>     
>
>   




More information about the erlang-questions mailing list