Simple Logic Palindrome in VB.Net.(Accept a string from user & check String is Palindrome Or not without use inbuilt Reverse Function)
PROPERTIES:
CODEING:
Button1 | |
Text | Palindrom |
Public Class Form1
Dim s As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each c As Char In TextBox1.Text
s = c & s
Next c
If s = TextBox1.Text Then
MsgBox(s & " is Palindrom")
Else
MsgBox(s & " is not Palindrom")
End If
s = ""
End Sub
End Class
DESIGNING:Dim s As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each c As Char In TextBox1.Text
s = c & s
Next c
If s = TextBox1.Text Then
MsgBox(s & " is Palindrom")
Else
MsgBox(s & " is not Palindrom")
End If
s = ""
End Sub
End Class
Comments
Post a Comment