NIndex Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represent a type can be used to index a collection either from the start or the end.
public value class NIndex : IEquatable<System::Buffers::NIndex>
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly struct NIndex : IEquatable<System.Buffers.NIndex>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type NIndex = struct
Public Structure NIndex
Implements IEquatable(Of NIndex)
- Inheritance
- Attributes
- Implements
int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ;
int lastElement = someArray[^1]; // lastElement = 5
``` int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ; int lastElement = someArray[^1]; // lastElement = 5 ```
NIndex(Index) | |
NIndex(Int |
Construct an NIndex using a value and indicating if the NIndex is from the start or from the end. |
End |
Create an NIndex pointing at beyond last element. |
Is |
Gets a value that indicates whether the NIndex is from the start or the end. |
Start |
Create an NIndex pointing at first element. |
Value |
Returns the NIndex value. |
Equals(NIndex) |
Indicates whether the current NIndex object is equal to another NIndex object. |
Equals(Object) |
Indicates whether the current NIndex object is equal to another object of the same type. |
From |
Create an NIndex from the end at the position indicated by the value. |
From |
Create an NIndex from the start at the position indicated by the value. |
Get |
Returns the hash code for this instance. |
Get |
Calculate the offset from the start using the giving collection length. |
To |
|
To |
Converts the NIndex to an Index without doing bounds checks. |
To |
Converts the value of the current NIndex object to its equivalent string representation. |
Checked |
|
Explicit(NIndex to Index) | |
Implicit(Index to NIndex) |
Converts native integer number to an NIndex. |
Implicit(Int |
Converts integer number to an NIndex. |
Produkt | Versioner |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: