Adds the value of an expression to the value of a variable and assigns the result to the variable. Also concatenates a String expression to a String variable and assigns the result to the variable.
variable += expression
This statement will implicitly perform widening but not narrowing conversions if the compilation environment is enforcing strict semantics. For details on these conversions, see
These examples use the += operator to combine the value of one variable with another. In the first example, += is used with numeric variables to add one value to another. In the second example, += is used with String variables to concatenate one value with another. In both cases, the result is assigned to the first variable.
Dim var1 As Integer = 10 Dim var2 As Integer = 3 var1+=
var2 ' The value of var1 is now 13. ' This example uses string variables. Dim var1 As String = "10" Dim var2 As String = "3" var1+=
var2 ' The value of var1 is now "103".
+ Operator | Arithmetic Operators | Concatenation Operators | Operator Precedence in Visual Basic | Operators Listed by Functionality