Fix Issue 11017 - Improve performance of toLower etc.

Changed to use `appender` instead of repeated `~=`.

https://d.puremagic.com/issues/show_bug.cgi?id=11017