I get a String and if that String contains a palindrome i have to return the palindrome. For example : "hsjwiUHUkajs" should return UHU, "hjakhdANNAjhad" should return ANNA.
How can I do that?
public static void main(String [] args) {
string s = "anna";
for(int i = 0; i<s.length; i++;) {
}
}