Click here to Skip to main content
15,881,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: convert part of a list to an array Pin
Dave Kreskowiak3-Jun-12 7:30
mveDave Kreskowiak3-Jun-12 7:30 
GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 7:56
VJ Reddy3-Jun-12 7:56 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 8:59
sitebuilderLuc Pattyn3-Jun-12 8:59 
GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 14:05
VJ Reddy3-Jun-12 14:05 
AnswerRe: convert part of a list to an array Pin
Richard Andrew x643-Jun-12 7:33
professionalRichard Andrew x643-Jun-12 7:33 
GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 7:57
VJ Reddy3-Jun-12 7:57 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 9:00
sitebuilderLuc Pattyn3-Jun-12 9:00 
AnswerRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 7:53
VJ Reddy3-Jun-12 7:53 
I think the Take extension method of IEnumerable can be used for this purpose as shown below:
C#
List<int> data = new List<int>(){1,2,3,4,5,6,7,8,9,10};
int[] array = data.Take(5).ToArray();

The Take method takes specified number of elements or the total elements of the list if the total is less than the specified number.
GeneralRe: convert part of a list to an array Pin
Richard Andrew x643-Jun-12 8:00
professionalRichard Andrew x643-Jun-12 8:00 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 9:00
sitebuilderLuc Pattyn3-Jun-12 9:00 
AnswerRe: convert part of a list to an array Pin
taha bahraminezhad Jooneghani3-Jun-12 8:05
taha bahraminezhad Jooneghani3-Jun-12 8:05 
AnswerRe: convert part of a list to an array PinPopular
Luc Pattyn3-Jun-12 8:58
sitebuilderLuc Pattyn3-Jun-12 8:58 
GeneralRe: convert part of a list to an array Pin
Dave Kreskowiak3-Jun-12 9:15
mveDave Kreskowiak3-Jun-12 9:15 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 9:26
sitebuilderLuc Pattyn3-Jun-12 9:26 
GeneralRe: convert part of a list to an array Pin
DaveyM694-Jun-12 8:18
professionalDaveyM694-Jun-12 8:18 
GeneralRe: convert part of a list to an array Pin
VJ Reddy3-Jun-12 13:51
VJ Reddy3-Jun-12 13:51 
GeneralRe: convert part of a list to an array PinPopular
Luc Pattyn3-Jun-12 14:28
sitebuilderLuc Pattyn3-Jun-12 14:28 
AnswerRe: convert part of a list to an array Pin
Apocalypse Now3-Jun-12 14:09
Apocalypse Now3-Jun-12 14:09 
GeneralRe: convert part of a list to an array Pin
Luc Pattyn3-Jun-12 14:30
sitebuilderLuc Pattyn3-Jun-12 14:30 
GeneralRe: convert part of a list to an array Pin
Apocalypse Now4-Jun-12 14:33
Apocalypse Now4-Jun-12 14:33 
QuestionSign Language Recognition Pin
RimaTeliani3-Jun-12 0:00
RimaTeliani3-Jun-12 0:00 
AnswerRe: Sign Language Recognition Pin
OriginalGriff3-Jun-12 0:29
mveOriginalGriff3-Jun-12 0:29 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 2:09
RimaTeliani3-Jun-12 2:09 
AnswerRe: Sign Language Recognition Pin
Richard MacCutchan3-Jun-12 0:53
mveRichard MacCutchan3-Jun-12 0:53 
GeneralRe: Sign Language Recognition Pin
RimaTeliani3-Jun-12 2:17
RimaTeliani3-Jun-12 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.