Further to solution 1 ...
The phrase
"A dog! A panic in a pagoda!"
is deemed to be a palindrome (according to
this list[
^]) but solution 1 will not agree because of the whitespace, punctuation marks and capitalisation
So an alternative solution is to remove all whitespace and non-character or digit characters from the source text and ensure it's all the same case e.g.
private static bool IsPalindrome(string sourceText)
{
var testChars = new string((from c in sourceText.ToLower()
where char.IsLetterOrDigit(c)
select c).ToArray());
for (var i = 0; i <= (testChars.Length % 2); i++)
if (testChars[i] != testChars[testChars.Length - i - 1]) return false;
return true;
}