mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-18 06:57:59 +01:00
13 lines
240 B
Elixir
13 lines
240 B
Elixir
defmodule Search.String do
|
|
def normalize(nil) do
|
|
""
|
|
end
|
|
|
|
def normalize(str) do
|
|
str
|
|
|> String.replace("\r", "")
|
|
|> String.split("\n", trim: true)
|
|
|> Enum.map(fn s -> "(#{s})" end)
|
|
|> Enum.join(" || ")
|
|
end
|
|
end
|