Ranges 1.0.10

dotnet add package Ranges --version 1.0.10
                    
NuGet\Install-Package Ranges -Version 1.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ranges" Version="1.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ranges" Version="1.0.10" />
                    
Directory.Packages.props
<PackageReference Include="Ranges" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ranges --version 1.0.10
                    
#r "nuget: Ranges, 1.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ranges@1.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ranges&version=1.0.10
                    
Install as a Cake Addin
#tool nuget:?package=Ranges&version=1.0.10
                    
Install as a Cake Tool

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: workflow-badge LICENSE: license-badge VERSION: 1.0.10


• Introduction • Usage • Installation • License


Introduction

Ranges

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Version Downloads Last Updated
1.0.10 33 10/13/2026
1.0.7 96 10/9/2026
1.0.6 83 10/8/2026
1.0.5 5,621 9/17/2024

Fix to support .NET 8 and package references for ValueTuple