Issue:
Need to see if one string is the beginning of another string
Solution:
Function StrBegins (fullString As String, subString As String) as Integer
' start failure
StrBegins = 0
' sanity check
If (fullString="") Then
Exit Function
End If
If (subString="") Then
Exit Function
End If
' compare two strings
If Instr ( fullString, subString) = 1 Then
StrBegins = 1
Else
' fullString does NOT start with subString , return failure
End If
End Function
previous page
|