mirror of
https://github.com/valitydev/fistful-server.git
synced 2024-11-06 10:45:21 +00:00
[WIP] Provide ff_string:join/1
w/ no delim
This commit is contained in:
parent
19d060b755
commit
1858ee327f
@ -3,19 +3,26 @@
|
||||
|
||||
-module(ff_string).
|
||||
|
||||
-export([join/1]).
|
||||
-export([join/2]).
|
||||
|
||||
%%
|
||||
|
||||
-spec join(Delim, [Fragment]) -> binary() when
|
||||
-type fragment() ::
|
||||
iodata() |
|
||||
char() |
|
||||
atom() |
|
||||
number() .
|
||||
|
||||
-spec join([fragment()]) -> binary().
|
||||
|
||||
join(Fragments) ->
|
||||
join(<<>>, Fragments).
|
||||
|
||||
-spec join(Delim, [fragment()]) -> binary() when
|
||||
Delim ::
|
||||
char() |
|
||||
iodata() ,
|
||||
Fragment ::
|
||||
iodata() |
|
||||
char() |
|
||||
atom() |
|
||||
number() .
|
||||
iodata() .
|
||||
|
||||
join(Delim, Fragments) ->
|
||||
genlib_string:join(Delim, lists:map(fun genlib:to_binary/1, Fragments)).
|
||||
|
Loading…
Reference in New Issue
Block a user