using System.Text.RegularExpressions;
public static bool IsPalindrome(string word)
Regex rg = new Regex(@"^[a-zA-Z0-9\s]*$");
word = Regex.Replace(word, "[^a-zA-Z0-9]", String.Empty);
int wordLength = word.Length -1;
for(int x=0; x<= word.Length-1; x++)
if(!string.IsNullOrEmpty(word[x].ToString()))
if(word[x] == word[wordLength - x] )
public static void Main(string[] args)
Console.WriteLine(Palindrome.IsPalindrome("Deleveled"));
Console.WriteLine(Palindrome.IsPalindrome("KAyak"));
Console.WriteLine(Palindrome.IsPalindrome("Never a foot too far, even."));