Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Like Operator
Like is a standard VB operator used to compare the contents of string expressions.
Syntax
string LIKE pattern
Placeholder Description string Any string or string expression pattern Any string expression to compare to string
Returns
-1 (TRUE) if string matches pattern, 0 (FALSE) otherwise.
Usage
pattern can include the following special characters:
Both ranges and lists can appear within a single set of square brackets. Ranges are matched according to their ANSI values. In a range, startchar must be less than endchar.
If either string or pattern is NULL, then the result value is NULL.
The Like operator respects the current setting of Option Compare.
For more information about operators, read Expressions.
Example
This example tests whether a letter is lowercase.
Sub Button_Click
Dim userstr as String
Dim revalue as Integer
Dim msgtext as String
Dim pattern
pattern = "[a-z]"
userstr = "E"
retvalue = userstr LIKE pattern
If retvalue = -1 then
msgtext = "The letter " & userstr & " is lowercase."
Else
msgtext = "Not a lowercase letter."
End If
End SubSee Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |