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 throw in c#?

519


What are static and dynamic variables?

648


What is array and arraylist?

544


What is access modifier in c#?

496


What is parsing?

530






What does int32 mean in c#?

470


Why do I get a "cs5001: does not have an entry point defined" error when compiling?

513


Is namespace necessary in c#?

491


Why do we use abstraction in c#?

476


Explain polymorphism in c# with a simple example?

516


What is the difference between method parameters and method arguments. Give an example?

517


Are c# references the same as c++ references?

550


What is returned if you pass the value 12.34 to the parsefloat () function?

532


What are c# attributes and its significance?

525


How we convert private assembly into public assembly?

524