Elixir List of Tuples to List of Strings

Advertisements

I want to take

[{'O', 'L'}, {'E', 'L'}, {'O', 'H'}, {'E', 'L'}, {'E', 'H'}]

and change it to

["OL", "EL", "OH", "EL", "EH"]

but I am not seeing how. Help?

>Solution :

Maybe like this:

Enum.map(my_list, fn {a, b} -> List.to_string([a, b]) end)

Leave a ReplyCancel reply