What would be an elegant way for converting a list of two item tuples like [{1,2},{3,4}] into the map %{1=>2, 3=>4}?
[{1,2},{3,4}]
%{1=>2, 3=>4}
Keyword list would be trivial, but what if we have arbitrary keys?
The simplest way to do this is:
Enum.into(list, %{})
How do I join two strings in a list with a space, like: ["StringA", "StringB"] becomes "StringA StringB"
In Elixir how do you check for type such as in Python: >>> a = "test" >>> type(a) <type 'str'> >>> b =10 >>> type(b) <type 'int'> I …
I need to convert a string to a floating point value or an integer. There was no method such as, string_to_integer