Check if .endWith function exist on String