Avoid un-necessary decode in startsWith/endsWith

As requested in #2503.

Perhaps it's overkill?
It checks if the range has any elements with a specific integral value, yes.