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?
public static bool IsPalindrome(string value) { int i = 0; int j = value.Length - 1; while (true) { if (i > j) { return true; } char a = value[i]; char b = value[j]; if (char.ToLower(a) != char.ToLower(b)) { return false; } i++; j--; } }