I have a string as input and have to break the string in two substrings. If the left substring equals the right substring then do some logic.
How can I do this?
A single line of code using Linq
Linq
public static bool IsPalindrome(string str) { return str.SequenceEqual(str.Reverse()); }