Wednesday, May 9, 2007

Palindrome

private void btCheck_Click(object sender, System.EventArgs e)
{
char[] Temp = TextBox1.Text.ToCharArray();
Array.Reverse(Temp);
string str = new String(Temp);
if(str == TextBox1.Text)
{
Response.Write(@"<script>alert('Palindrome')</script>");
}
else
{
Response.Write(@"<script>alert('!Palindrome')</script>");
}
}

No comments: