any suggestions on how to convert
this:
[mss: “Market Support Specialist”]
to this:
[{“mss”, “Market Support Specialist”}]
thanku
any suggestions on how to convert
this:
[mss: “Market Support Specialist”]
to this:
[{“mss”, “Market Support Specialist”}]
thanku
or…
iex(20)> your_atom = :ThisIsYourAtom
:ThisIsYourAtom
# Kernel.to_string/1
iex(21)> to_string(your_atom)
"ThisIsYourAtom"
# String interpolation
iex(22)> "#{your_atom}"
"ThisIsYourAtom"
@lc0815 orth nothing that you list will no longer be a keyword-list, therefore loosing the benefits of access syntax (ie. list[:mss]
). You may consider it the possibility of converting it to a map where you can use strings as keys, if the code allows it, (also considered duplicate keys in your keywords list will be lost when converted into a map)
Enum.map(keywords, fn {key, value} -> {to_string(key), value} end)
PS: consider what @eksperimental said.
Thank you all, found the Atom.to_string
function which did the right thing for me and converted the atom to a string and solved my issue…
Thanks again…
did just that and found the Atom.to_string
function which worked perfectly…