I am new to c#. I have a List of 100 records. I want to take between 20 to 30 index records.
Is there any easy way of getting this without for loop ??
Yes, You can use .Skip() and .Take() methods.
Try this code:
Records = Records.Skip(20).Take(10).ToList();
This will skip first 20 records and takes next 10 record.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With