C# '+=' Operator

前端 未结 2 1534
别那么骄傲
别那么骄傲 2021-01-29 17:02

I have some code that contains the operator \'+=\'.

Specifically, the code reads as follows:

foreach (KeyValuePair row in connecti         


        
2条回答
  •  误落风尘
    2021-01-29 17:34

    It adds two strings(or ints etc) together.

    String a = "Hello";
    a += " World";
    

    String a now = "Hello World"

    int i = 0;
    i += 2;
    

    int I now = 2

提交回复
热议问题