There are canonical answers to this question for every popular language, even though that answer usually boils down to: "Use string.endsWith() from the standard library". For Ada, as far as I can find in the docs for the Fixed String package, there is no string.endswith function.
So, given two fixed strings A and B, how do you check if A ends with B?
declare
A : constant String := "John Johnson";
B : constant String := "son";
begin
if A.Ends_With(B) then -- this doesn't compile
Put_Line ("Yay!");
end if;
end
My intent is to establish a standard answer for Ada.