Replace startsWith and endsWith if startsWith is not spec compliant.