check if string ends with a certain string, optionally ignoring case