Dim rc As Boolean = "2" Like "*?<*?"
I don’t understand why rc equals True, surely 2 is not like *?<*? at all.
The above pattern requires a string with
- At least three characters (two ?’s and a
<) - where the
<symbol is somewhere on the interior.
As far as I can work out < is not a special character that means something other than < to the Like operator.
Using Visual Studio 2010.
While I can’t directly explain why
2is like"*?<*?".Your query reads;
*– Match 0 or more characters?– Followed by one single character<– Followed by the<character*– Followed by 0 or more characters?– Terminated by one single characterFor your logic you want;
Which results in a query of;
Which reads;
???– Match at least 3 characters*– Followed by any number of further characters<– Followed by the<character*– Followed by any number of further charactersNot a direct answer I know, but I hope it helps all the same…
EDIT:
To answer your comment below.
You would like to;
Which results in a query of;
This would return False as a result, as would;
However;
Would return true.
I hope this helps (more!)