您的位置:首页 > 编程语言 > C#

数组段

2014-07-22 21:14 162 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int[] arri = new int[] { 1, 2, 3, 4, 5 };
ArraySegment<int> ass = new ArraySegment<int>(arri, 1, 3);//索引从第1个到第三个
foreach (int item in ass)
{
Console.WriteLine(item);//输入2,3,4
}
Console.ReadKey();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息