Write code for palindrome?

Answer Posted / kautilya

bool CheckPalindrom(string MyString)
{
string strChar1 = "";
string strChar2 = "";
for (int i = 0; i < ((MyString.Length - 1) / 2);
i++)
{
strChar1 = MyString.Substring(i, 1);
strChar2 = MyString.Substring((MyString.Length -
(i+1)), 1);
if (strChar1 != strChar2)
return false;
}
return true;
}

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which sorting algorithm is best?

735


What is a cs file?

732


What is delegate in c# interview questions?

681


How do you escape in c#?

715


Define c# i/o classes? List the commonly used classes?

726


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

797


Is php better than c#?

665


What is literal control

756


What does do in c#?

707


Explain how do I get deterministic finalization in c#?

675


Define thread?

747


Hello! How to do this: "Create manifest utility intended for creating update content files. Application should take a set of files as input parameter and generate XML based manifest file as output one." I use C# and vs.net 2003. It's urgent! Help please, thanks. Mayana

1688


What is razor view in c#?

625


What is the difference between system.text.stringbuilder and system.string?

721


What is the namespcae generally given to the webpage of the .NET Framework ?

784