I need to eliminate the last character of the string of 's'
I have tried to use a variable to have it set to the last character and used that variable to put it in the parameters of the subscript but I get an error when doing so.
public static void noLast(String s){
char last = s.charAt(s.length() - 1);
System.out.println(s.substring(0,last));
java.lang.StringIndexOutOfBoundsException: begin 0, end 108, length 5
This is the error I get when I put the string variable as 'hello' and try to eliminate the 'o'