NRange Struct
Definition
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 range that has start and end indices.
public value class NRange : IEquatable<System::Buffers::NRange>
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public readonly struct NRange : IEquatable<System.Buffers.NRange>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type NRange = struct
Public Structure NRange
Implements IEquatable(Of NRange)
- Inheritance
- Attributes
- Implements
Remarks
``` int[] someArray = new int[5] { 1, 2, 3, 4, 5 }; int[] subArray1 = someArray[0..2]; // { 1, 2 } int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } ```
Constructors
NRange(NIndex, NIndex) |
Construct an NRange object using the start and end NIndexes. |
NRange(Range) |
Properties
All |
Create an NRange object starting from first element to the end. |
End |
Represent the exclusive end NIndex of the NRange. |
Start |
Represent the inclusive start NIndex of the NRange. |
Methods
EndAt(NIndex) |
Create an NRange object starting from first element in the collection to the end NIndex. |
Equals(NRange) |
Indicates whether the current NRange object is equal to another NRange object. |
Equals(Object) |
Indicates whether the current NRange object is equal to another object of the same type. |
GetHashCode() |
Returns the hash code for this instance. |
GetOffsetAndLength(IntPtr) |
Calculate the start offset and length of NRange object using a collection length. |
StartAt(NIndex) |
Create an NRange object starting from start NIndex to the end of the collection. |
ToRange() | |
ToRangeUnchecked() | |
ToString() |
Converts the value of the current NRange object to its equivalent string representation. |
Operators
CheckedExplicit(NRange) | |
Explicit(NRange to Range) | |
Implicit(Range to NRange) |
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για