码迷,mamicode.com
首页 > Windows程序 > 详细

C#的Tuple

时间:2017-08-23 19:10:44      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:int   pre   span   tuple   不用   一个   div   对象   不同   

 Tuple<string, string, string, int, DateTime> s = new Tuple<string, string, string, int, DateTime>("a","b","c",1,DateTime.Parse("2017-8-23"));  


一种class,当成string类型用,区别是可以存储多个不同或相同的数据类型,并且没有key的限制
(1)可以用于方法的返回值中,返回多个不同(类型)的值,就不用out,ref等关键字。out,ref 太单一。
(2)线程中传参,就不用传对象类型的了。一个tuple搞定


C#的Tuple

标签:int   pre   span   tuple   不用   一个   div   对象   不同   

原文地址:http://www.cnblogs.com/wwz-wwz/p/7419591.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!