hi
I want to implement this program correctly
about plindrom like ( ara) is plindrom
i try to writed code for non-recursivly
but i didn't understand method CharAt ()
IgnorCase()
import java.util.Scanner;
public class Plindrom {
public static void main (String[] args)
{
String str;
int left, right;
Scanner scan = new Scanner (System.in);
System.out.println ("Enter string or sentence: ");
str = scan.nextLine();
left = 0;
right = str.length() - 1;
while (left < right) { // continue until they reach center
if (str.charAt(left) != str.charAt(right)) {
System.out.println(" it is plindrom");
}
left++; // move left index toward the center
right--; // move right index toward the center
}
System.out.println(" it is not plindrom");
}}