How to delete array range using linq query without looping

Array contains 1000 line items how to delete 100 line items using linq

@Aravinthan

You mean first 100 line items?

Array.Enumerable.skip(100).ToArray

Hope this may help you

Thanks

image
enumerable not found bro in string of array

i have string of array of 1000 items in that i will take 1st 100 items and need to delete that 100 items and then next 100 items i will take and then will delete

like this:
dt = dt.AsEnumerable.Skip(100).CopyToDataTable

EDIT:
because the input is array then:
array = array.skip(100).ToArray

Cheers

2 Likes

Hi @Aravinthan , you can directly access the skip function without using enumerable for array. for eg:- array.take(number of items you require)

Using loop you can increment the counter value and skip the first n number of terms and take the next n numbers

@Aravinthan

It’s AsEnumerable

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.