String ends with?
Elixir
defmodule EndsWith do
def solution(str, ending) when ending == "", do: true
def solution(str, ending) do
string_len = String.length(str)
search_len = String.length(ending)
ending == String.slice(str, -search_len, string_len)
end
end