Skip to content

Instantly share code, notes, and snippets.

@Ts-Pytham
Created January 11, 2021 23:00
Show Gist options
  • Save Ts-Pytham/7b6f0eb4c275062c4aa05313384584ad to your computer and use it in GitHub Desktop.
Save Ts-Pytham/7b6f0eb4c275062c4aa05313384584ad to your computer and use it in GitHub Desktop.
Función que calcula las palabras palíndromas
static bool Palindroma(string palabra)
{
palabra = palabra.Replace(" ", "");
palabra = palabra.ToLower();
int len = palabra.Length;
for(int i = 0; i != len - 1; ++i)
{
if (palabra[i] != palabra[len - 1])
return false;
len--;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment