CodeItBetter Programming Another VB Programming Blog

How to use Like() function

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
'Coding Basics - How to use Like() function
'Like() function used for Pattern-Matching in Code
Dim strTest  As String
 
strTest = "@ciSmith v. Barney, 21 A2d 459, 35 ME2d 256 (1985)@ec"
 
'The following comparisons will result in True or False results as indicated:
Result = strTest Like "*F2d*" '(Result would be False)
Result = strTest Like "*A2d*" '(Result would be True)
Result = strTest Like "@ci*@ec" '(Result would be True)

'One glitch is that It doesn't recognized "[0-9]@" whereas it will recognize 
'particular occurrences of the character class.  "[0-9][0-9][0-9]"
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.