exercism/elixir/isogram/lib/isogram.ex

10 lines
238 B
Elixir
Raw Normal View History

2024-07-06 17:42:59 +00:00
defmodule Isogram do
@doc """
Determines if a word or sentence is an isogram
"""
@isogram ~r/(\w).*\1/i
@spec isogram?(String.t()) :: boolean
def isogram?(sentence), do: !Regex.match?(@isogram, String.downcase(sentence))
end