DEV Community

Discussion on: Daily Challenge #178 - Create Phone Numbers

Collapse
 
savagepixie profile image
SavagePixie

Elixir

I'm sure there's a much simpler way, though.

defmodule Phone do
  def get_number([ a, b, c, d, e, f, g, h, i, j ]) do
    "(#{a}#{b}#{c}) #{d}#{e}#{f}-#{g}#{h}#{i}#{j}"
  end
end