如何创建与C#整数序列阵? [英] How to create array with sequence of integers in C#?
本文介绍了如何创建与C#整数序列阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
F#拥有的序列的允许创建序列:
F# has sequences that allows to create sequences:
seq { 0 .. 10 }
创建数字序列从0到10。
Create sequence of numbers from 0 to 10.
有没有在C#中类似的东西?
Is there something similar in C#?
推荐答案
您可以使用 Enumerable.Range(0,10);
。例如:
var seq = Enumerable.Range(0, 10);
MSDN的网页。这里。
这篇关于如何创建与C#整数序列阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文