Generation

generate functionThu, 27 Apr 2023

Comprobar si una cadena contiene a otra cadena.

defmodule StringHelper do def contains?(string, substring) do String.contains?(string, substring) end end IO.puts StringHelper.contains?("Hello world", "world") IO.puts StringHelper.contains?("Hello world", "elixir")

Questions about programming?Chat with your personal AI assistant