C# Check whether the String is a palindrome or not. code example
Example 1: C# Check whether the String is a palindrome or not.
var original = "ankYkna";
var reversed = new string(original.Reverse().ToArray());
var palindrom = original == reversed;
Example 2: C# Check whether the String is a palindrome or not.
return myString.SequenceEqual(myString.Reverse());
Example 3: C# Check whether the String is a palindrome or not.
public static bool IsPalindrome(string str)
{
return str.SequenceEqual(str.Reverse());
}