Hi
In so many time, they will ask this question in interview to check the programming skill of developer.
How can check the palindrome string like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;public partial class Program_Palindrom_of_String : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}
protected void Button1_Click(object sender, EventArgs e)
{
string s = TextBox1.Text.ToString();
string str = string.Empty;
for (int j = s.Length-1; j >= 0; j–)
{
//store the reverse string
str = str + s[j];
}
//check with input value
if (s == str)
{
Label1.Text = s + " is palindrom";
}
else
{
Label1.Text = s + " is not palindrom";
}
}
}
thank u its useful for me
Nice to know.