Table of Contents

Class Slice

Namespace
NAPS2.ImportExport
Assembly
NAPS2.Sdk.dll

A class that represents a Python-style slice of a collection. https://stackoverflow.com/questions/509211/understanding-pythons-slice-notation/509295#509295

For example, "2:-3" gets all but the first 2 and last 3 items. Stepping is supported too, as in "::2" which gets every other item.

public class Slice
Inheritance
Slice
Inherited Members

Fields

Default

public static readonly Slice Default

Field Value

Slice

Properties

End

public int? End { get; }

Property Value

int?

Index

public int? Index { get; }

Property Value

int?

Start

public int? Start { get; }

Property Value

int?

Step

public int? Step { get; }

Property Value

int?

Methods

Indices(int)

public IEnumerable<int> Indices(int collectionLength)

Parameters

collectionLength int

Returns

IEnumerable<int>

Item(int?)

public static Slice Item(int? index)

Parameters

index int?

Returns

Slice

Parse(string, out string)

public static Slice Parse(string input, out string rest)

Parameters

input string
rest string

Returns

Slice

Range(int?, int?, int?)

public static Slice Range(int? start, int? end, int? step)

Parameters

start int?
end int?
step int?

Returns

Slice