Class IntRange
Range bounded by int numbers. Alternative to System.Range without at end indexes support.
With System.Range you have to know length of sequence for ^1 like indices and so can't calculate Length of range.
Inheritance
System.Object
IntRange
Assembly: Eco.Shared.dll
Syntax
public sealed class IntRange : ValueType
Constructors
IntRange(Int32, Int32)
Declaration
public IntRange(int start, int end)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
System.Int32 |
end |
|
Fields
End
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Start
Declaration
public readonly int Start
Field Value
Type |
Description |
System.Int32 |
|
Properties
Length
Declaration
public int Length { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
After(IntRange, Int32)
Makes new IntRange right after the range
with specified length
.
Declaration
public static IntRange After(IntRange range, int length)
Parameters
Type |
Name |
Description |
IntRange |
range |
|
System.Int32 |
length |
|
Returns
FromOffsetAndLength(Int32, Int32)
Makes IntRange from offset
and length
instead of two indexes.
Declaration
public static IntRange FromOffsetAndLength(int offset, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Operators
Implicit(IntRange to Range)
Implicitly converts to System.Range for array accessors etc.
Declaration
public static implicit operator Range(IntRange range)
Parameters
Returns
Type |
Description |
System.Range |
|
Extension Methods