Avoid un-necessary decode in startsWith/endsWith

As requested in #2503.

Perhaps it's overkill?
A bit late to the thread but I'd expect it to only work if `char` contains code point and find nothing / throw otherwise. Allowing searching for code units would be most confusing here (and indexing `char[]` is something I'd just prohibit with DScanner in user code). But I do support @andralex position on this topic in general.