Changed string[] to string.charAt()