New version of NSlice has been released. What’s new?

  • SliceDelete extension method for indexed and string types.

SliceDelete returns exactly opposite result than Slice. The result set is ordered in the same way as the original one. Look at the following example that returns first 2 and last 2 elements:

var collection = Enumerable.Range(0, 10).ToList();
collection.SliceDelete(2, -2); 
collection.SliceDelete(-3, 1, -1);

Result: { 0, 1, 8, 9 }

You can read more about NSlice in one of the previous posts: Slicing for .NET


Available on NuGet – type “nslice”.
Project website and source code: