Avoid use of endsWith since it is relatively new.