Write code for palindrome?

Answer Posted / karthi sanjivi

class Program
{
static void Main()
{
Console.WriteLine("Please Enter Value : ");
string _strValue = Console.ReadLine();
bool res = CheckPalindrome(_strValue);
Console.WriteLine(res);
Console.ReadLine();
}

private static bool CheckPalindrome(string _strValue)
{
string _strTempValue = _strValue;
string _strRevValue = string.Empty;
char[] ch = _strTempValue.ToCharArray();
Array.Reverse(ch);
_strRevValue = new string(ch);
return (_strRevValue == _strValue);
}
}

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is array and types of array in c#?

475


What is the difference between console application and windows application?

476


Is equal in c#?

507


What are the delegates in c#?

476


What is the property of class?

576






How to add controls dynamically to the form using c#.net.

471


How the versioning applies to Assemblies or can you explain version numbers?

566


Why dictionary is faster than list?

553


Can a class have more than 1 destructor?

511


Why do we need singleton class in c#?

533


Describe the difference between inline and code behind - which is best?

553


Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?

534


Are string objects mutable or immutable?

526


Which constructor is called first in c#?

515


what is c# command?

499