using System;
class MyString
{
public static void Main()
{
IsPalindrome("xxxxxxxx"); }
public static bool IsPalindrome(String strParam)
{
int iLength,iHalfLen;
iLength=strParam.Length-1;
iHalfLen=iLength/2;
for(int iIndex=0;iIndex<=iHalfLen;iIndex++)
{
if(strParam.Substring(iIndex,1)!=strParam.Substring(iLength-iIndex,1))
{
console.writeline("not palindrome");
return false;
}
}
console.writeline("palindrome");
return true;
} }
Hope it helps.
-Manas