Combine a list of strings with a conjunction
In mix.exs
:
def deps do
[{:conjunction, "~> 1.0.2"}]
end
Then run mix deps.get
.
Conjunction.join(["red", "blue"])
# => "red and blue"
Conjunction.join(["red", "blue"], "or")
# => "red or blue"
Conjunction.join(["red", "blue", "white"])
# => "red, blue, and white"
Conjunction.join(["red", "blue", "white"], "or")
# => "red, blue, or white"
MIT © Dustin Specker