using System;
using System.Linq;
namespace ConsoleApplication2
{
class Program
{
static bool IsPalindrome(string s)
{
// the code:
var x=s.ToLower().Where(char.IsLetterOrDigit);return x.SequenceEqual(x.Reverse());
}
static void Main()
{
TestPalindrome("racecar");
TestPalindrome("rAceCaR");
TestPalindrome("ra1cecar");
TestPalindrome("ra1cec1ar");
TestPalindrome("ra1c\te.c;1ar");
}
static void TestPalindrome(string s)
{
Console.WriteLine("[{0}] is {1}a palindrome", s, IsPalindrome(s) ? "" : "not ");
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uTGlucTsKCm5hbWVzcGFjZSBDb25zb2xlQXBwbGljYXRpb24yCnsKICAgIGNsYXNzIFByb2dyYW0KCXsKICAgICAgICBzdGF0aWMgYm9vbCBJc1BhbGluZHJvbWUoc3RyaW5nIHMpCgkJewogICAgICAgICAgICAvLyB0aGUgY29kZToKCQkJdmFyIHg9cy5Ub0xvd2VyKCkuV2hlcmUoY2hhci5Jc0xldHRlck9yRGlnaXQpO3JldHVybiB4LlNlcXVlbmNlRXF1YWwoeC5SZXZlcnNlKCkpOwoJCX0KICAgICAgICAKCQlzdGF0aWMgdm9pZCBNYWluKCkKCQl7CgkJCVRlc3RQYWxpbmRyb21lKCJyYWNlY2FyIik7CgkJCVRlc3RQYWxpbmRyb21lKCJyQWNlQ2FSIik7CgkJCVRlc3RQYWxpbmRyb21lKCJyYTFjZWNhciIpOwoJCQlUZXN0UGFsaW5kcm9tZSgicmExY2VjMWFyIik7CgkJCVRlc3RQYWxpbmRyb21lKCJyYTFjXHRlLmM7MWFyIik7CgkJfQoKCQlzdGF0aWMgdm9pZCBUZXN0UGFsaW5kcm9tZShzdHJpbmcgcykKCQl7CgkJCUNvbnNvbGUuV3JpdGVMaW5lKCJbezB9XSBpcyB7MX1hIHBhbGluZHJvbWUiLCBzLCBJc1BhbGluZHJvbWUocykgPyAiIiA6ICJub3QgIik7CgkJfQoJfQp9Cg==