public static bool Check(String word)
string first = word.Substring(0, word.Length / 2);
char[] arr = word.ToCharArray();
string temp = new string(arr);
string second = temp.Substring(0, temp.Length / 2);
return first.ToLower().Equals(second.ToLower());
public static void Main()
Assert(() => Palindrome.Check("Deleveled"), true);
Assert(() => Palindrome.Check("Action"), false);
Assert(() => Palindrome.Check("noon"), true);
Assert(() => Palindrome.Check("Noon"), true);
private static void Assert(Func<bool> test, bool expectedResult)
if(test() != expectedResult)
Console.WriteLine("Test {0} failed!", testCount);
Console.WriteLine("Test {0} Passed!", testCount);
Console.WriteLine("Test {0} threw {1}: {2}", testCount, ex.GetType().Name, ex.Message);
private static int testCount = 0;