c# multi assignment

后端 未结 7 1832
温柔的废话
温柔的废话 2020-12-16 13:54
int a, b, n;
...
(a, b) = (2, 3);
// \'a\' is now 2 and \'b\' is now 3

This sort of thing would be really helpfull in C#. In this example \'a\' and

7条回答
  •  渐次进展
    2020-12-16 14:09

    The closest structure I can think of is the Tuple class in version 4.0 of the framework.

提交回复
热议问题