List: GetRange
//GetRange
// Returns
//List GetRange
//using System;
//using System.Collections.Generic;
class Program
{
static void Main()
{
List<string> robots = new List<string>(new string[]
{
"CombatBot",
"UtilityBot", //robot 2
"SharkBot", // robot3
"CleanerBot", // robot4
"TalkBot"
});
//Get robots 2 through 4
List<string> range = robots.GetRange(1,3);
foreach (string robot in range)
{
Console.WriteLine(robot);
}
}
}
/*
Output:
UtilityBot
SharkBot
CleanerBot
*/