philomena/lib/search/string.ex
2019-11-02 16:31:55 -04:00

9 lines
202 B
Elixir

defmodule Search.String do
def normalize(str) do
str
|> String.replace("\r", "")
|> String.split("\n", trim: true)
|> Enum.map(fn s -> "(#{s})" end)
|> Enum.join(" || ")
end
end