string:join ?

Per Hedeland <>
Fri Jun 11 00:43:54 CEST 2004


"Robert Virding" <> wrote:
>
>What is string:join supposed to do? If it just a simple concatenation of two
>strings then S1 ++ S2 well defined and efficient.

'man perlfunc' (ducking:-)

Or

join(List, Sep) ->
    lists:foldl(fun(A, "") -> A;
		   (A, Acc) -> Acc ++ Sep ++ A
		end, "", List).

Or

"The opposite of string:tokens/2" (sort of).

Or at least that's what I assume... (And I agree that it's "missing".:-)

--Per Hedeland

>----- Original Message ----- 
>From: "David N. Welton" <>
>To: <>
>Sent: Wednesday, June 09, 2004 4:12 PM
>Subject: string:join ?
>
>
>> Hi,
>>
>> I was looking through the docs and didn't notice a string:join function.
>>     It would be, IMHO, a useful little utility.  I've written my own,
>> but I think it's a common enough operation that "leaving it as an
>> excersize for the reader" might not be optimal.
>>
>> Thankyou,
>> -- 
>> David N. Welton
>> 
>>
>
>



More information about the erlang-questions mailing list