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

Can you mark static constructor with access modifiers?

548


What is the difference between static class and abstract class in c#?

460


What is eager and lazy loading in c#?

463


Why we need get set property in c#?

538


What is dll in vb.net?

480






Can an int be negative c#?

581


What is private static in c#?

475


what optimizations does the c# compiler perform when you use the /optimize+ compiler option?

592


What is private class in c#?

480


How do I declare a pure virtual function in c#?

586


What is entity framework c#?

455


When would you use generics in your code c#?

488


Is predicate a functional interface?

482


What does an indexer do?

476


What are variables in c#?

489