String.contains-question-mark
You're seeing just the function
contains-question-mark, go back to String module for more information.
Specs
Checks if string contains any of the given contents.
contents can be either a string, a list of strings,
or a compiled pattern.
Examples
iex> String.contains?("elixir of life", "of")
true
iex> String.contains?("elixir of life", ["life", "death"])
true
iex> String.contains?("elixir of life", ["death", "mercury"])
falseThe argument can also be a compiled pattern:
iex> pattern = :binary.compile_pattern(["life", "death"])
iex> String.contains?("elixir of life", pattern)
trueAn empty string will always match:
iex> String.contains?("elixir of life", "")
true
iex> String.contains?("elixir of life", ["", "other"])
trueBe aware that this function can match within or across grapheme boundaries.
For example, take the grapheme "é" which is made of the characters
"e" and the acute accent. The following returns true:
iex> String.contains?(String.normalize("é", :nfd), "e")
trueHowever, if "é" is represented by the single character "e with acute"
accent, then it will return false:
iex> String.contains?(String.normalize("é", :nfc), "e")
false