< Public Function IsWhiteSpace (OneLine As String) As Boolean (?)

Comments

'------------------------------------------------------------------------- 'Determine if a given string contains only white-space 'Returns False if string contains anything other than 'space or tab '-------------------------------------------------------------------------

Public Function IsWhiteSpace (OneLine As String) As Boolean

    IsWhiteSpace = True
    Select Case Len(OneLine)
        Case 0:
        Case 1:
            If Not ((OneLine = " ") Or (OneLine = vbTab)) Then
                IsWhiteSpace = False
            End If
        Case Else
    
            Dim i As Integer
            Dim chChar As Byte
            For i = 1 To Len(OneLine)
                chChar = Asc(Mid(OneLine, i, 1))
                If Not ((chChar = 32) Or (chChar = 9)) Then
                    IsWhiteSpace = False
                End If
            Next
    End Select
End Function


Copying, Return to index