Repeat a string n times in elixir
I need to make a string of a defined length. In ruby, I would use:
str = 'a' * 5
How do I accomplish the same thing in elixir?
You can use String.duplicate/2:
iex(1)> str = String.duplicate("a", 5) "aaaaa"