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 the difference between add and addrange in c#?

745


Can a private virtual method can be overridden?

744


list the steps in code compilation in c#?

652


What is difference between static and readonly in c#?

637


Define a jagged array in c#?

653


What is thread life cycle in c#?

681


Does the system.exception class have any cool features?

695


Define a manifest in .net?

755


What does exclamation mark mean c#?

745


What is string pool in c#?

750


what is an exception in .net?

700


What is a .aspx file?

630


Can bool be null c#?

670


What are constructors in c#?

713


What is using keyword in C#?

780