use charAt as array notation is not available in IE8

`"foo"[0]` is not available in IE < 9. Use `charAt` instead.