Gerard O'Donnell

Gerard O'Donnell Gerard O'Donnell

Niner since 2004

Comments

  • Gary Daniels and Evan Goldring - Mock whiteboard problem

    Just so the VB.NET folks don't feel too left out...

    Private Function IsPalindrome(ByVal TestString As String) As Boolean

    Dim First As Integer = 0

    Dim Last As Integer = TestString.Length - 1

    While First < Last

       If TestString.Substring(First, 1) = TestString.Substring(Last, 1) Then

    First += 1

    Last -= 1

    Else

    Return False

    End If

    End While

    Return True

    End Function