What is wrong with the below statement? [code] Msg.Text=”This is an example”&ControlChars.NewLine&“Example”. [/code]

What is wrong with the below statement?
Code:
Msg.Text=”This is an example”&ControlChars.NewLine&“Example”.
A. Used double quotes, should have used single quotes
B. No errors
C. There should be spaces before and after each &
D. Should have ended with a ;
 
Answer: C
Explanation: The & operator is used to concatenate strings and should be preceded and followed by a space. It is a logical operator. Thus the syntax of the above statement is wrong, as there is no space in before and after & operator.
 

Tìm kiếm

Back
Top