Based on your description it seems pretty straightforward.
Code:
// simulate a 'random' value
var randomValue = 3;
// create the input list
var stringList = new List<String> { {"This"}, {"is"}, {"a"}, {"string"}, {"test." }};
// Print out the input list
Console.WriteLine("Original List");
foreach (var s in stringList)
{
Console.WriteLine(String.Format("\t{0}", s));
}
// Extract the list elements from the original list based on
// the 'randomValue'. Start at the beginning of the list.
var subList = stringList.GetRange(0, randomValue);
// Print out the extracted values.
Console.WriteLine("\nSublist");
foreach (var s in subList)
{
Console.WriteLine(String.Format("\t{0}", s));
}
Outputs:
Code:
Original List
This
is
a
string
test.
Sublist
This
is
a
Bookmarks