Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Index

Assembly: System.Runtime

Represents a type that can be used to index a collection either from the beginning or the end.

Properties

public bool
IsFromEnd
Gets a value that indicates whether the index is from the start or the end.
public int
Value
Gets the index value.

Methods

public bool
Equals​(Index other)
other The object to compare with this instance.
Returns <see langword="true" /> if the current Index object is equal to <paramref name="other" /> ; <see langword="false" /> otherwise.
Returns a value that indicates whether the current object is equal to another <see cref="T:System.Index" /> object.
public bool
Equals​(object value)
value An object to compare with this instance.
Returns <see langword="true" /> if <paramref name="value" /> is of type <see cref="T:System.Index" /> and is equal to the current instance; <see langword="false" /> otherwise.
Indicates whether the current Index object is equal to a specified object.
public int
GetHashCode​()
Returns The hash code.
Returns the hash code for this instance.
public int
GetOffset​(int length)
length The length of the collection that the Index will be used with. Must be a positive value.
Returns The offset.
Calculates the offset from the start of the collection using the specified collection length.
public string
ToString​()
Returns The string representation of the <see cref="T:System.Index" /> .
Returns the string representation of the current <see cref="T:System.Index" /> instance.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .