Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created January 4, 2014 00:34
Show Gist options
  • Save mikedugan/8249670 to your computer and use it in GitHub Desktop.
Save mikedugan/8249670 to your computer and use it in GitHub Desktop.
not incredibly useful, but a basic method to determine if a string is a palindrome
public static bool IsPalindrome(string value)
{
int min = 0;
int max = value.Length - 1;
while (true)
{
if (min > max)
{
return true;
}
char a = value[min];
char b = value[max];
if (char.ToLower(a) != char.ToLower(b))
{
return false;
}
min++;
max--;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment