using System.Collections.Generic;
using System.Globalization;
public static void Main()
string[] array = { "civic", "aabb", "deified", "p2P", "microsoft", "deleveled", null,
"level", "madam", "raceCar", "Net", "repaper",
"A", "", "reviver", "rotator", "MadamImAdam", "*$$*",
"sagas", "xyz", "Palindrome", "tacoCat", "stats"
Array.ForEach<string>(array, w => {var r = a.IsAPalindrome(w); Console.WriteLine("{0} is {1} a palindrome", w, r);});
public bool IsAPalindrome(string word)
if (string.IsNullOrEmpty(word))
for (var i = 0; i < word.Length/2; i++)
if (word[i] != word[word.Length - 1 - i])