A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.

public static bool IsPalindrome(this string input)
     {
         bool result = true;
         input = input.Trim();
         try
         {

             if (string.IsNullOrEmpty(input))
             {
                 return result = false;
             }

             var inputArray = input.ToCharArray();

             if (inputArray.Length == 1)
             {
                 return result = true;
             }

             int length = inputArray.Length – 1;

             for (int i = 0; i <= length / 2; i++)
             {
                 if (inputArray[i] != inputArray[length – i])
                 {
                     return result == false;
                 }
             }
         }
         catch (Exception)
         {

             result = false;
         }
         return result;

     }
Test Case

string s = "";
Console.WriteLine(string.Format("String {0} IsPalindrome {1}", s, s.IsPalindrome()));
s = "AJAY";
Console.WriteLine(string.Format("String {0} IsPalindrome {1}", s, s.IsPalindrome()));
s = "ABBA";
Console.WriteLine(string.Format("String {0} IsPalindrome {1}", s, s.IsPalindrome()));
s = "ABBa";
Console.WriteLine(string.Format("String {0} IsPalindrome {1}", s, s.IsPalindrome()));
s = "palindrome";
Console.WriteLine(string.Format("String {0} IsPalindrome {1}", s, s.IsPalindrome()));

Output:

String  IsPalindrome False
String AJAY IsPalindrome False
String ABBA IsPalindrome True
String ABBa IsPalindrome False
String palindrome IsPalindrome False