using System;
public class Program
{
public static void Main()
string str = ".forgeeksskeegr..of.";
Console.WriteLine(isPali(str));
}
private static bool isPali(string str)
var strLen = str.Length;
if (strLen == 0 || strLen == 1)
return true;
int s = 0;
int e = strLen - 1;
while (e>s)
while (!Char.IsLetter(str[s])) {
if (s<e)
s++;
else
return false;
while (!Char.IsLetter(str[e])) {
if (e>1)
e--;
if (str[s] == str[e])
if (s == 0)
strLen--;