在C#中,可以使用以下方法创建元组:
- 使用Tuple类:
Tuple<int, string> tuple = new Tuple<int, string>(1, "hello");- 使用ValueTuple结构:
ValueTuple<int, string> valueTuple = (1, "hello");- 使用强类型方法创建元组:
var tuple = (count: 1, message: "hello");上一篇:.NET中的PublicKeyToken怎么用
下一篇:怎么快速搭建springMVC框架项目
C









