Private Sub Command1_Click()
Dim st As String, rst As String
st = InputBox("Enter any string")
st = UCase(st)
For i = Len(st) To 1 Step -1
rst = rst & Mid(st, i, 1)
Next i
If rst = st Then
Console.write "Palindrome"
Else
Console.Write "Not-Palindrome"
End If
End Sub
_______________________________________
i really dont know how to construct array..
please help me with this..
i dont have any installer of VB .NET right now..
i only do some of my projects and homeworks in school.
could somebody help me with this?
i want to display the palindrome or not palindrome in a messagebox..
ang using text input box, how will i be able to accpt inputs or phrase using it?
HERES THE BROBLEM:
a program to accept a string and [b]determines
if the String is a palindrome. Define a recursive procedure
TestPalindrome that returns True if the String stored in the
array is a palindrome, but False otherwise.
The procedure should ignore spaces and punctuation in the String. [Hint: A String can be converted to a Char array using method ToCharArray. For instance, the statement:
myArray = myString.ToCharArray()
stores the contents of string variable myString in
one-dimensional Char array myArray.]
This post has been edited by sidyey: 15 November 2006 - 10:19 AM

New Topic/Question
Reply



MultiQuote



|