mainrotor
asked on
I need to check the first 3 characters of a string in VB6
Hi Experts,
I need to check the first 3 characters of a string in VB6. I need to read a string and find out if the first 3 characters equal 'DF-' . How can I do this?
Thanks in advance,
mrotor
I need to check the first 3 characters of a string in VB6. I need to read a string and find out if the first 3 characters equal 'DF-' . How can I do this?
Thanks in advance,
mrotor
You need to read from:
- file
- db
- console
-
-
?
To check you use
if Left(yourString, 3) = "DF-" then
- file
- db
- console
-
-
?
To check you use
if Left(yourString, 3) = "DF-" then
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I've tightened up the function above a little more as well ...
Function SearchStr(strToSearch As String, sFind As String, iStart As Integer, iLen As Integer) As Boolean
SearchStr = IIf(StrComp(Mid$(strToSearch, iStart, iLen), sFind, vbTextCompare) = 0, True, False)
End Function
pls try
Open in new window
Regards