Fix Str::endsWith() with needles that start with space and numbers.
Merge pull request #5310 from loduis/4.2

Fix Str::endsWith() with needles that start with space and numbers.