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?
String extension method, easy to use:
public static bool IsPalindrome(this string str) { str = new Regex("[^a-zA-Z]").Replace(str, "").ToLower(); return !str.Where((t, i) => t != str[str.Length - i - 1]).Any(); }