Closed mwgkgk closed 6 years ago
I was debating on whether to add something like that or not... at present there is interpolate
(%
) but also join
:
(“This” “is” “a” “test”) “ “ join
It’s not as easy as a concat but it lets you customize the separator...
("asdf" "bsdf") "" join
seems reasonable! Concat would only be 1 argument shorter.
You can define a symbol for concatenating. I'll show you how:
( symbol combine
(quot :elems ==> string :result)
(elems "" join @result)
) ::
OR
( =elems
elems (quot) expect
-> "" join
) :combine
Use it like:
("asd" "fgh") combine puts
It puts "asdfgh"
.
What is the preferred method of concatenating two strings? Should we format them using interpolate? Is it reasonable to ask for
concat-str
? Maybe something I overlooked? Thank you :)