gpt4 book ai didi

c# - 如何将项目添加到命名元组

转载 作者:行者123 更新时间:2023-12-05 00:52:42 25 4
gpt4 key购买 nike

我有以下命名的元组列表

var tupleList = new List<(string SureName, string LastName, int Age)>();

如何使用 tupleList.Add 将项目添加到该列表?

最佳答案

var tupleList = new List<(string SureName, string LastName, int Age)>();
tupleList.Add(("a", "b", 3));

enter image description here

如您所见,它要求在添加末尾添加一个项目,这似乎是可选的,也是双括号的原因。

关于c# - 如何将项目添加到命名元组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69491903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com