Thursday, December 15, 2011

Palindrome Test

1. Design the following:



2. Enter the code as follows:


Public Class frmPalindromeTest

Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click

Dim Result As String

txtReverse.Text = Microsoft.VisualBasic.StrReverse(txtInput.Text)

Result = Microsoft.VisualBasic.StrComp(txtInput.Text, txtReverse.Text)

If Result = 0 Then

lblResult.Text = "The string is a Palindrome"

Else
lblResult.Text = "The string is not a Palindrome"

End If
End Sub

End Class

3. Save and Run the program.

No comments:

Post a Comment