Check For A Substring Match
Using Erlang's :binary.match
function, you can easily check if a string has a matching substring.
As you can see, the return value on a successful match is a tuple with the index of where the match starts and the length of the match. If there is no match, the :nomatch
atom is returned.
See the match/2
and match/3
docs for more details.
Last updated