What is the difference between:
string1 + string2
and
string1 & string2
Are they equivalent? Why have two different symbols that do the same thing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The expressions are the same as long as the operands are strings; if not,
+might add them instead depending on type conversions.&guarantees you won’t get anything except a string concatenation, and will convert operands to strings if possible to do so.There’s an MSDN entry about Concatenation operations in Visual Basic that explains it: