由网友(你眼里有星星)分享简介:使用String类,你可以这样做:With the String class, you can do:string text = new string('x', 5);//text is "xxxxx"什么是创建一个列表与其中最短的途径; T>这是充满了 N 这些都是相同的参考因素?What's the sho...
使用String类,你可以这样做:
With the String class, you can do:
string text = new string('x', 5);
//text is "xxxxx"
什么是创建一个列表与其中最短的途径; T>这是充满了 N
这些都是相同的参考因素?
What's the shortest way to create a List< T > that is full of n
elements which are all the same reference?
推荐答案
请尝试以下
var l = Enumerable.Repeat('x',5).ToList();
相关推荐
最新文章