Hi, I have an iEnumerable collection, how do I select only the first 2 items without looping? i’ve seen the code somewhere it looks like next() and skip() but I’m not exactly sure how it works
newdt = myDataTable.AsEnumerable().Take(2).CopyToDataTable
so if I want to extract it as an Array, is this the code?
arr = enum.Take(2).ToArray?
yes @DEATHFISH that should work…
ok now the error that I’m facing is that enum is type
iEnumerable<Object> and I want to produce arr which is of type
String. What is the most efficient way of doing this?
what kind of items you have in your enum collection…
the enum is from Excel Read Column activity
(From x in Enumobj.Take(2) select y = x.ToString).ToArray