Im having a bit of a problem with this code each time i execute it it gives me an error String index out of range: \'n\' n - is the no. of characters that is entered in the tex
In java string.charAt(string.length()) will be out of bounds since the string is 0 indexed and so the last character is at string.length() - 1.
string.charAt(string.length())
string.length() - 1