IE9 doesn't support addressing characters as array indices

I don't know about other versions, but my version of IE9 doesn't support string characters using array indices.

Replaced "text[...]" with "text.charAt(...)" which fixed the issue for me.