Current section
Files
Jump to
Current section
Files
lib/util.ex
defmodule Util do
@moduledoc """
Util module containing helpful functions used in the project.
"""
@doc """
Function for format string and replace spaces with '+' for url format.
## Parameters
- text (string): Text to be formatted in the url format.
## Examples
iex> Util.format_string("Macabra Pune")
"Macabra+Pune"
"""
def format_string(text) do
text
|> Kernel.inspect
|> String.replace(" ", "+")
end
end