defmodule MatchStick do
def doMatch("a" <> rest) do 1 end
def doMatch(_) do 0 end
end
You need to use the string concatenation operator seen here
Example:
iex> "he" <> rest = "hello"
"hello"
iex> rest
"llo"
defmodule MatchStick do
def doMatch("a" <> rest) do 1 end
def doMatch(_) do 0 end
end
You need to use the string concatenation operator seen here
Example:
iex> "he" <> rest = "hello"
"hello"
iex> rest
"llo"