public static void Main()
string str = "A man, a plan, a canal: Panama";
Console.WriteLine(IsPalindrome(str));
static bool IsPalindrome(string str)
var newstr = new string(str.Where(p => IsPunctuation(p))
Console.WriteLine(newstr);
return newstr.Equals(new string(newstr.Reverse().ToArray()));
static bool IsPunctuation(char p)
return !char.IsPunctuation(p) && !char.IsWhiteSpace(p) && !char.Equals(p, '`');