Ramstack.Structures 1.2.0

dotnet add package Ramstack.Structures --version 1.2.0                
NuGet\Install-Package Ramstack.Structures -Version 1.2.0                
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="Ramstack.Structures" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ramstack.Structures --version 1.2.0                
#r "nuget: Ramstack.Structures, 1.2.0"                
#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.
// Install Ramstack.Structures as a Cake Addin
#addin nuget:?package=Ramstack.Structures&version=1.2.0

// Install Ramstack.Structures as a Cake Tool
#tool nuget:?package=Ramstack.Structures&version=1.2.0                

Ramstack.Structures

Ramstack.Structures is a .NET library providing various data structures and utilities.

.NET

Installation

To install the Ramstack.Structures NuGet package to your project, use the following command:

dotnet add package Ramstack.Structures

Features

The current release includes primary types:

  • Ramstack.Text.StringView:<br>Represents a read-only view of a string, providing safe and efficient access to a subset of its characters.
  • Ramstack.Collections.ArrayView<T>:<br>A generic read-only view of an array, allowing safe and efficient access to a subset of its elements.
  • Ramstack.Collections.ReadOnlyArray<T>:<br>A generic read-only array wrapper, similar to ImmutableArray<T>, but with some performance improvements and better code generation in certain cases.

Additionally, the library provides the StringViewComparer class, which offers various comparators accessible through corresponding properties:

Property Description
Ordinal Gets a StringViewComparer object that performs a case-sensitive ordinal string comparison.
OrdinalIgnoreCase Gets a StringViewComparer object that performs a case-insensitive ordinal string comparison.
CurrentCulture Gets a StringViewComparer object that performs case-sensitive string comparisons using the word comparison rules of the current culture.
CurrentCultureIgnoreCase Gets a StringViewComparer object that performs case-insensitive string comparisons using the word comparison rules of the current culture.
InvariantCulture Gets a StringViewComparer object that performs a case-sensitive string comparison using the word comparison rules of the invariant culture.
InvariantCultureIgnoreCase Gets a StringViewComparer object that performs a case-insensitive string comparison using the word comparison rules of the invariant culture.

Notes

The ArrayView<T> and ReadOnlyArray<T> types have a ref readonly indexer, which provides efficient access to elements of the underlying array, avoiding expensive copying in the case of large structures.

This same optimization is also applied to the enumerators of these types. The Current property has a ref readonly signature, which enables the following pattern when necessary:

foreach (ref readonly HeavyStruct s in view)
{
    ...
}

Changelog

1.2.0

  • Add Trim overloads to StringView class

Supported versions

Version
.NET 6, 7, 8

Contributions

Bug reports and contributions are welcome.

License

This package is released as open source under the MIT License. See the LICENSE file for more details.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 113 7/11/2024
1.1.1 104 7/10/2024
1.1.0 86 7/9/2024
1.0.0 112 6/30/2024