Created
January 17, 2016 19:28
-
-
Save darinwilson/229010e0da0e4f292628 to your computer and use it in GitHub Desktop.
LearnElixir.tv Episode 8 Exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def join(strs, separator) do | |
last = List.last(strs) | |
for str <- strs, into: "" do | |
if str != last do | |
str <> separator | |
else | |
str | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment