Console.Write("Entra una paraula o frase (o 'TENET' per acabar): ");
input = Console.ReadLine();
bool isPalindrome = IsPalindrome(input);
Console.WriteLine($"'{input}' és un palíndrom: {isPalindrome}");
} while (input != "TENET");
static bool IsPalindrome(string str)
string cleaned = str.Replace(" ", "").ToLower();
char[] charArray = cleaned.ToCharArray();
Array.Reverse(charArray);
return cleaned == new string(charArray);