In the following code, the body of If will execute if strFirst contains? [code]If strFirst.ToUpper Like "T[OI]M" Then[/code]

Ánh Dương

New member
In the following code, the body of If will execute if strFirst contains?
Code:
If strFirst.ToUpper Like "T[OI]M" Then
A. TIM
B. TM
C. IM
D. OM
 
Answer: A
Explanation: The body of If will execute if the condition evaluates to True. The condition evaluates to True when the string stored in the strFirst variable (converted to uppercase) is either “TOM” or “TIM”. When the variable does not contain “TOM” or “TIM” the condition evaluates to False. In this case we see that “TIM” matches the condition, thus if strFirst is “Tim” then it will execute the body of the If.
 

Tìm kiếm

Back
Top