Ranges 1.0.10
dotnet add package Ranges --version 1.0.10
NuGet\Install-Package Ranges -Version 1.0.10
<PackageReference Include="Ranges" Version="1.0.10" />
<PackageVersion Include="Ranges" Version="1.0.10" />
<PackageReference Include="Ranges" />
paket add Ranges --version 1.0.10
#r "nuget: Ranges, 1.0.10"
#:package Ranges@1.0.10
#addin nuget:?package=Ranges&version=1.0.10
#tool nuget:?package=Ranges&version=1.0.10
Ranges
Range & indexing support for legacy .NET Frameworks
Description
CREATED BY: [Latency McLaughlin]
UPDATED: 10/12/2026
FRAMEWORKS: net45, net451, net452, net46, net461, net462, net47, net471, net472, net48, net481, netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0, net11.0
LANGUAGE: [C#] preview
OUTPUT TYPE: Library [API]
SUPPORTS: [Visual Studio]
GFX SUBSYS: [None]
TAGS: [C#], [.NET], [API], [Visual Studio]
STATUS:
LICENSE:
VERSION: 1.0.10
Navigation
• Introduction • Usage • Installation • License
Introduction
This repository provides implementations (copied from corefx) of System.Index and System.Range for legacy .NET Frameworks.
C# 8.0 introduced the index (^) and range (..) operators to simplify accessing single elements and slices in arrays and collections. See also index and range features
For projects that target netstandard2.0 or .NET Framework 4.6.2 or later, use the Microsoft.Bcl.Memory, which should already be included in the netstandard2.0+ / NET Core frameworks.
• This library shall be considered deprecated and only relevant for legacy targeted frameworks. • This library is not necessary nor recommended when targeting versions of .NET that include the relevant support.
Usage
Index Operator (^)
The caret (^) counts positions from the end of a sequence rather than the start: • ^1 is the last element (50) • ^2 is the second-to-last element (40) • ^0 points to the length of the array (accessing numbers[^0] throws an IndexOutOfRangeException, just like numbers[length])
int[] numbers = { 10, 20, 30, 40, 50 };
Console.WriteLine(numbers[0]); // Output: 10 (first element)
Console.WriteLine(numbers[^1]); // Output: 50 (last element)
Console.WriteLine(numbers[^2]); // Output: 40 (second-to-last element)
Range Operator (..)
int[] slice = numbers[1..4];
// Extracts elements from index 1 up to, but not including, index 4
// Result: { 20, 30, 40 }
The double-dot (..) extracts a subset (slice) of a collection. • Start index is inclusive (the item at this position is included). • End index is exclusive (the item at this position is not included).
Installation
This library can be installed using NuGet found here.
License
The source code for the site is licensed under the MIT license, which you can find in the MIT-LICENSE.txt file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net45 is compatible. net451 is compatible. net452 is compatible. net46 is compatible. net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.5.1
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.5.2
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.6
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.6.1
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.6.2
- AssemblyLoader (>= 1.2.6)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.7
- AssemblyLoader (>= 1.2.6)
-
.NETFramework 4.7.1
- AssemblyLoader (>= 1.2.6)
-
.NETFramework 4.7.2
- AssemblyLoader (>= 1.2.6)
-
.NETFramework 4.8
- AssemblyLoader (>= 1.2.6)
-
.NETFramework 4.8.1
- AssemblyLoader (>= 1.2.6)
-
.NETStandard 2.0
- AssemblyLoader (>= 1.2.6)
-
.NETStandard 2.1
- AssemblyLoader (>= 1.2.6)
-
net10.0
- AssemblyLoader (>= 1.2.6)
-
net11.0
- AssemblyLoader (>= 1.2.6)
-
net8.0
- AssemblyLoader (>= 1.2.6)
-
net9.0
- AssemblyLoader (>= 1.2.6)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Ranges:
| Package | Downloads |
|---|---|
|
NDesk.Options.Core
A callback-based program option parser for C#. |
|
|
AsyncTask
Asynchronous Task Extension Library |
|
|
CSTypes
C# Types Argument Parser |
|
|
BitField.Extensions
.NET Library For BitField & Enum Extensions |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Ranges:
| Repository | Stars |
|---|---|
|
uholeschak/ediabaslib
.NET BMW and VAG Ediabas interpreter library
|
Fix to support .NET 8 and package references for ValueTuple