Unless I'm missing something, you have a typo in the second example. It should be lowks not low.
iex(1)> Enum.filter(String.split("lowks kian seong"), fn(x) -> x == "lowks" end)
["lowks"]
Frage
Why does this work:
iex(9)> Enum.filter(["lowks", "kian", "seong"], fn(x) -> x == "lowks" end)
["lowks"]
While this does not:
iex(5)> Enum.filter(String.split("low kian seong"), fn(x) -> x == "lowks" end)
[]
Is it because I am filtering the function ?
Lösung
Unless I'm missing something, you have a typo in the second example. It should be lowks not low.
iex(1)> Enum.filter(String.split("lowks kian seong"), fn(x) -> x == "lowks" end)
["lowks"]