char getLast(String str, int index) { if (index == str.length() - 1) return str.charAt(index); return getLast(str,index+1); } code example
Example: java get first char
char fourth = "Banana".charAt(3);
char fourth = "Banana".charAt(3);