Skip to content

Instantly share code, notes, and snippets.

@abhilash0001
Created January 14, 2020 18:02
Show Gist options
  • Save abhilash0001/7435cc913abb3e95aee69bc94763ec83 to your computer and use it in GitHub Desktop.
Save abhilash0001/7435cc913abb3e95aee69bc94763ec83 to your computer and use it in GitHub Desktop.
internal string isPalindrome(string str)
{
bool flag = false;
if (!string.IsNullOrEmpty(str))
{
for (int i = 0, j = str.Length -1; i < str.Length /2; i++, j--)
{
if (str[i] != str[j])
{
flag = false;
break;
}
else
flag = true;
}
}
return flag ? "Palindrome" : "Not Palindrome";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment