Attribute VB_Name = "StringFunctions"

Option Explicit

Public Sub RegressionTestStringFunctions()
    Debug.Assert MidRange("123456789", 3, 7) = "34567"
    Debug.Assert MidRange("abcde", 2, 2) = "b"
    Debug.Assert MidRange("abcde", 2, 5) = "bcde"
    Debug.Assert MidRange("abcde", 4, 5) = "de"
    Debug.Assert NoWhiteSpace(vbTab & "Te st i" & vbTab & "ng  ") = "Testing"
End Sub

Public Function NoWhiteSpace(T As String) As String
    NoWhiteSpace = Replace(Replace(T, " ", ""), vbTab, "")
End Function

Public Function MidRange(T As String, StartIndex As Long, EndIndex As Long) As String
    MidRange = Mid$(T, StartIndex, EndIndex - StartIndex + 1)
End Function
