SharedTools 1.1.1

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

// Install SharedTools as a Cake Tool
#tool nuget:?package=SharedTools&version=1.1.1

SharedTools

NuGet NuGet

Opis

Paczka NuGet SharedTools zawiera prostą bibliotekę umożliwiającą łatwe odczytywanie tekstu z plików oraz kilka Extension Methods zawierających operacje pomocne w rozwiązywaniu zadań z Advent Of Code.

Instalacja

Aby zainstalować paczkę NuGet, możesz skorzystać z konsoli zarządzania pakietami w Visual Studio:

dotnet add package SharedTools

Wykorzystanie

new FileReader(string path, ReadOption readOption)

Opis

Odczytuje tekst z zasobu. Rezultat przypisuje do propercji.

Parametry:

string path - ścieżka zasobu

ReadOption readOption - Sposób odczytu, do wyboru ReadOption.All oraz ReadOption.Lines. W przypadku nie podania, domyślnie obiera opcje All.

Zwraca:

void

Exceptions

https://learn.microsoft.com/en-us/dotnet/api/system.io.file.readalltext?view=net-8.0

Klasa ExtensionMethods

IEnumerable<T>.WithIndex<T>()

Opis

Przy użyciu forech'a obiekt opakowany jest w tuple z indeksem (T,i)

Parametry:

brak

Zwraca

IEnumerable<(T item, int index)>, oraz w przypadku iteracji obiekt (T,i)

Exceptions

ArgumentNullException w przypadku kiedy wywołana na obiekcie null

string.ReplaceWhitespace(string replacement)

Opis

Zamienia w ciągu znaków wszystkie whitespace'y na podany ciąg znaków

Parametry:

string replacement - definiuje na jaki ciąg znaków zmienić whitespace ;domyślna wartość ""

Zwraca

string oryginalny ciąg znaków z podmianą whitespace'ów

Exceptions

ArgumentNullException w przypadku kiedy wywołana na obiekcie null RegexMatchTimeoutException w przypadku gdy na dopasowanie przeznaczone zostanie za dużo czasu

IList<T>.PopMax<T>()

Opis

Zwraca max wartość kolekcji przy okazji usuwając ją.

Parametry:

brak

Zwraca

T element kolekcji o maksymalnej wartości

Generyczność

Elementy listy muszą dziedziczyć po struct oraz implementować podane interfejsy: IComparable, IFormattable, IConvertible, IComparable<T>, IEquatable<T>

Exceptions

ArgumentException ArgumentNullException w przypadku kiedy wywołana na obiekcie null

Ostatnie zmiany 1.1.0

+Dodano do klasy ExtensionMethods metodę IList<T>.PopMax<T>()

+Dodano do klasy ExtensionMethods metodę string.ReplaceWhitespace(string replacement)

Licencja

MIT

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 was computed.  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.
  • net6.0

    • No dependencies.

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.1.1 167 11/30/2023
1.1.0 72 11/30/2023
1.0.0 81 11/29/2023