Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def remove_sequential_spaces(value) do
# TODO how can this be expressed via pattern matching?
if String.starts_with?(value, "\"") || String.ends_with?(value, "\"") do
value
else
String.replace(value, ~r/\ {2,}/, " ")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.