0

hi,
how to compare part of the string
ex:
i have XX-BP-XXXXXXXXXXXXXXX

i want to check wherther the string starts with XX-BP
how can i do that

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by QVeen72
0

Hi,

use any of these:
Suppose
MyStr ="XX-BP-XXXXXXXXXXXXXXX"

If MyStr Like "XX-BP*" Then
  MsgBox "True"
Else
  MsgBox "False
End If

Or

If Left(MyStr,5) = "XX-BP" Then
  MsgBox "True"
Else
  MsgBox "False
End If

Or

If InStr(MyStr ,"XX-BP")>0  Then
  MsgBox "True"
Else
  MsgBox "False
End If

Regards
Veena

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.