Use charAt instead of indicies to support ES3 strings