string:join ?

Per Hedeland hedeland@REDACTED
Fri Jun 11 00:43:54 CEST 2004


"Robert Virding" <robert.virding@REDACTED> 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" <davidw@REDACTED>
>To: <erlang-questions@REDACTED>
>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
>> davidw@REDACTED
>>
>
>



More information about the erlang-questions mailing list