Code
Sub Main()
Dim myString As New String("You can cage a swallow, can't you, but you can't swallow a cage, can you")
Dim myStrings As New List(Of String)()
myStrings = myString.Replace(",", "").Split(" ").ToList()
For i As Integer = 0 To myStrings.Count - 1
If String.Equals(myStrings.Item(i), myStrings.Item(myStrings.Count - 1 - i), StringComparison.OrdinalIgnoreCase) Then
Else
Console.WriteLine("Not a Palindrome")
Console.ReadLine()
Return
End If
Next
Console.WriteLine("Palindrome!")
Console.ReadLine()
End Sub
redundancy is redundant
ignore it if you see it
edit: got rid of it
now with less lists
This post was edited by Eep on May 8 2015 05:56pm