ktsu.Extensions
1.3.2
Prefix Reserved
dotnet add package ktsu.Extensions --version 1.3.2
NuGet\Install-Package ktsu.Extensions -Version 1.3.2
<PackageReference Include="ktsu.Extensions" Version="1.3.2" />
paket add ktsu.Extensions --version 1.3.2
#r "nuget: ktsu.Extensions, 1.3.2"
// Install ktsu.Extensions as a Cake Addin #addin nuget:?package=ktsu.Extensions&version=1.3.2 // Install ktsu.Extensions as a Cake Tool #tool nuget:?package=ktsu.Extensions&version=1.3.2
ktsu.Extensions
A utility library of extension methods designed to enhance the functionality of collections, enumerables, dictionaries, strings, and reflection in .NET. This library provides utilities for explicit shallow and deep cloning, batch operations, and advanced string manipulations, making it easier to work with common data structures and types.
Features
Enumerable Extensions
WithIndex
: Enumerates over an enumerable with the index of the item.ToCollection
: Converts an enumerable to a collection.ForEach
: Applies an action to each element of an enumerable.DeepClone
: Creates a deep clone of a collection of items.ShallowClone
: Creates a shallow clone of a collection of items.AnyNull
: Checks if the enumerable contains any null items.WriteItemsToConsole
: Writes the items of the enumerable to the console, skipping null items.ToStringEnumerable
: Converts an enumerable to an enumerable of strings, handling null items according to the specified behavior.Join
: Joins the items of the enumerable into a single string using the specified separator.
Collection Extensions
AddMany
: Adds items from an enumerable to a collection.AnyNull
: Checks if the collection contains any null items.ToStringCollection
: Converts a collection to a collection of strings, handling null items according to the specified behavior.WriteItemsToConsole
: Writes the items of the collection to the console, skipping null items.
Dictionary Extensions
GetOrCreate
: Gets the value associated with the specified key or creates a new value if the key does not exist.AddOrReplace
: Adds a new value or replaces the existing value for the specified key.DeepClone
: Creates a deep clone of a dictionary.ShallowClone
: Creates a shallow clone of a dictionary.
String Extensions
As<TDest>
: Converts a weak string to a strong string of the specified type, or converts between strong string types.StartsWithOrdinal
: Compares two strings using ordinal comparison to check if the string starts with the specified value.EndsWithOrdinal
: Compares two strings using ordinal comparison to check if the string ends with the specified value.ContainsOrdinal
: Compares two strings using ordinal comparison to check if the string contains the specified value.RemoveSuffix
: Removes the specified suffix from the current string.RemovePrefix
: Removes the specified prefix from the current string.ReplaceOrdinal
: Replaces all occurrences of a string with another string using ordinal comparison.DetermineLineEndings
: Determines the line ending style of the specified string.NormalizeLineEndings
: Normalizes the line endings in the specified string to the specified style.
Reflection Extensions
TryFindMethod
: Tries to find a method with the specified name and binding flags in the given type.
Installation
To install the library, use the following NuGet command:
dotnet add package ktsu.Extensions
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- ktsu.DeepClone (>= 1.1.14)
- ktsu.StrongStrings (>= 1.2.26)
-
net9.0
- ktsu.DeepClone (>= 1.1.14)
- ktsu.StrongStrings (>= 1.2.26)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ktsu.Extensions:
Package | Downloads |
---|---|
ktsu.StrongPaths
A library that provides strong typing for common filesystem paths providing compile time feedback and runtime validation. |
|
ktsu.ToStringJsonConverter
A JSON converter factory for .NET that simplifies the serialization and deserialization of custom types using ToString and FromString methods. |
|
ktsu.ImGuiStyler
A library for expressively styling ImGui.NET interfaces. |
|
ktsu.ImGuiWidgets
A library of custom widgets using ImGui.NET and utilities to enhance ImGui-based applications. |
|
ktsu.ImGuiPopups
A library for custom popups using ImGui.NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.2 | 200 | 1/2/2025 |
1.3.2-pre.9 | 29 | 1/7/2025 |
1.3.2-pre.8 | 36 | 1/6/2025 |
1.3.2-pre.7 | 51 | 1/4/2025 |
1.3.2-pre.6 | 38 | 1/3/2025 |
1.3.2-pre.5 | 42 | 1/3/2025 |
1.3.2-pre.4 | 43 | 1/3/2025 |
1.3.2-pre.3 | 59 | 1/1/2025 |
1.3.2-pre.2 | 65 | 12/31/2024 |
1.3.2-pre.1 | 48 | 12/29/2024 |
1.3.1 | 372 | 12/28/2024 |
1.3.0 | 73 | 12/28/2024 |
1.2.16-pre.3 | 39 | 12/28/2024 |
1.2.16-pre.2 | 42 | 12/27/2024 |
1.2.16-pre.1 | 43 | 12/27/2024 |
1.2.15-pre.1 | 43 | 12/27/2024 |
1.2.14 | 386 | 12/26/2024 |
1.2.13 | 79 | 12/26/2024 |
1.2.12 | 77 | 12/26/2024 |
1.2.11 | 76 | 12/26/2024 |
1.2.10 | 77 | 12/26/2024 |
1.2.10-pre.1 | 42 | 12/27/2024 |
1.2.9 | 79 | 12/26/2024 |
1.2.8 | 581 | 12/26/2024 |
1.2.7 | 1,013 | 12/24/2024 |
1.2.6 | 476 | 12/23/2024 |
1.2.5 | 71 | 12/23/2024 |
1.2.4 | 429 | 12/22/2024 |
1.2.3 | 94 | 12/22/2024 |
1.2.2 | 125 | 12/22/2024 |
1.2.1 | 140 | 12/22/2024 |
1.2.0 | 615 | 12/19/2024 |
1.1.0 | 78 | 12/19/2024 |
1.0.37 | 521 | 12/13/2024 |
1.0.36 | 657 | 12/5/2024 |
1.0.35 | 331 | 12/4/2024 |
1.0.34 | 446 | 12/2/2024 |
1.0.33 | 81 | 12/2/2024 |
1.0.32 | 283 | 12/2/2024 |
1.0.31 | 412 | 12/1/2024 |
1.0.30 | 219 | 12/1/2024 |
1.0.29 | 82 | 12/1/2024 |
1.0.28 | 149 | 11/30/2024 |
1.0.27 | 264 | 11/28/2024 |
1.0.26 | 298 | 11/26/2024 |
1.0.25 | 884 | 11/14/2024 |
1.0.24 | 307 | 11/13/2024 |
1.0.23 | 807 | 11/2/2024 |
1.0.22 | 361 | 11/1/2024 |
1.0.21 | 1,050 | 10/16/2024 |
1.0.20 | 679 | 10/5/2024 |
1.0.19 | 221 | 10/4/2024 |
1.0.18 | 767 | 9/21/2024 |
1.0.17 | 271 | 9/19/2024 |
1.0.16 | 96 | 9/19/2024 |
1.0.15 | 270 | 9/19/2024 |
1.0.14 | 199 | 9/19/2024 |
1.0.13 | 205 | 9/19/2024 |
1.0.12 | 127 | 9/18/2024 |
1.0.11 | 108 | 9/18/2024 |
1.0.10 | 166 | 9/18/2024 |
1.0.9 | 629 | 9/18/2024 |
1.0.8 | 442 | 9/14/2024 |
1.0.7 | 120 | 9/14/2024 |
## v1.3.2 (unknown)
Changes since v1.3.2-pre.3:
- Add automation scripts for metadata management and versioning ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.3.1 (patch)
Changes since v1.3.0:
- Refactor LineEndingStyle enumeration to standalone ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.3.0 (minor)
Changes since v1.2.0:
- Add line ending methods and tests, update README ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Refactor test method names and update LICENSE ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Renamed metadata files ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Replace LICENSE file with LICENSE.md and update copyright information ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.2.15-pre.1 (patch)
Changes since v1.2.14:
- Renamed metadata files ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.2.10 (patch)
Changes since v1.2.9:
- Replace LICENSE file with LICENSE.md and update copyright information ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.2.8 (patch)
Changes since v1.2.7:
- Refactor test method names and update LICENSE ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.2.0 (minor)
Changes since v1.1.0:
- Add comprehensive unit tests for Join method ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Add Join extension methods to EnumerableExtensions ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Update README.md to document new Join extension method ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.1.0 (minor)
Changes since v1.0.0:
- Add a locket overload of ForEach ([@matt-edmondson](https://github.com/matt-edmondson))
- Add AddOrReplace method to DictionaryExtensions ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Add an overload to ToCollection that takes an object to acquire a lock on while enumerating ([@matt-edmondson](https://github.com/matt-edmondson))
- Add collection handling and conversion extensions ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Add CollectionExtensions with AddMany method ([@matt-edmondson](https://github.com/matt-edmondson))
- Add DeepClone enumerable extension ([@matt-edmondson](https://github.com/matt-edmondson))
- Add DeepClone for dictionaries ([@matt-edmondson](https://github.com/matt-edmondson))
- Add new tests and refactor extension methods ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Add new unit tests ([@matt-edmondson](https://github.com/matt-edmondson))
- Add ShallowClone to enumerables and dictionaries ([@matt-edmondson](https://github.com/matt-edmondson))
- Add string.As<StrongStrong>() ([@Matt Edmondson](https://github.com/Matt Edmondson))
- Add support for GetOrCreate on concurrent dictionaries ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix Dictionary return types ([@matt-edmondson](https://github.com/matt-edmondson))
- Migrate ktsu.io to ktsu namespace ([@Matt Edmondson](https://github.com/Matt Edmondson))
- Minor code style changes ([@matt-edmondson](https://github.com/matt-edmondson))
- Update DESCRIPTION and overhaul README.md ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
- Update package references and add ILCompiler dependency ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.0.31 (patch)
Changes since v1.0.30:
- Update package references and add ILCompiler dependency ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.0.30 (patch)
Changes since v1.0.29:
- Add new tests and refactor extension methods ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.0.29 (patch)
Changes since v1.0.28:
- Add collection handling and conversion extensions ([@Matthew Edmondson](https://github.com/Matthew Edmondson))
## v1.0.14 (patch)
Changes since v1.0.13:
- Add string.As<StrongStrong>() ([@Matt Edmondson](https://github.com/Matt Edmondson))
## v1.0.8 (patch)
Changes since 1.0.7:
- Migrate ktsu.io to ktsu namespace ([@Matt Edmondson](https://github.com/Matt Edmondson))
## v1.0.0 (major)
Changes since 0.0.0.0:
- Add an overload of GetOrCreate for dictionaries that takes a supplied default value ([@matt-edmondson](https://github.com/matt-edmondson))
- Add DictionaryExtensions.GetOrCreate() ([@matt-edmondson](https://github.com/matt-edmondson))
- Add EnumerableExtensions hoisted from ImGuiApp ([@matt-edmondson](https://github.com/matt-edmondson))
- Add ForEach to enumerable extensions ([@matt-edmondson](https://github.com/matt-edmondson))
- Add github package support ([@matt-edmondson](https://github.com/matt-edmondson))
- Add IEnumerable.ToCollection ([@matt-edmondson](https://github.com/matt-edmondson))
- Add ReplaceOrdinal for strings ([@matt-edmondson](https://github.com/matt-edmondson))
- Add String extensions for StrongStrings ([@matt-edmondson](https://github.com/matt-edmondson))
- Added RemoveSuffix and RemovePrefix ([@matt-edmondson](https://github.com/matt-edmondson))
- Assign dependabot PRs to matt ([@matt-edmondson](https://github.com/matt-edmondson))
- Avoid double upload of symbols package ([@matt-edmondson](https://github.com/matt-edmondson))
- Create dependabot-merge.yml ([@matt-edmondson](https://github.com/matt-edmondson))
- Create VERSION ([@matt-edmondson](https://github.com/matt-edmondson))
- Dont try to push packages when building pull requests ([@matt-edmondson](https://github.com/matt-edmondson))
- Enable dependabot and sourcelink ([@matt-edmondson](https://github.com/matt-edmondson))
- Initial commit ([@matt-edmondson](https://github.com/matt-edmondson))
- Make Dictionary.GetOrCreate not return a nullable ([@matt-edmondson](https://github.com/matt-edmondson))
- Migrate from .project.props to Directory.Build.props ([@matt-edmondson](https://github.com/matt-edmondson))
- Read from AUTHORS file during build ([@matt-edmondson](https://github.com/matt-edmondson))
- Read from VERSION when building ([@matt-edmondson](https://github.com/matt-edmondson))
- Read PackageDescription from DESCRIPTION file ([@matt-edmondson](https://github.com/matt-edmondson))
- Update .project.props ([@matt-edmondson](https://github.com/matt-edmondson))
- Update build config ([@matt-edmondson](https://github.com/matt-edmondson))
- Update build scripts ([@matt-edmondson](https://github.com/matt-edmondson))
- Update descriptions and readme ([@matt-edmondson](https://github.com/matt-edmondson))
- Update Directory.Build.props ([@matt-edmondson](https://github.com/matt-edmondson))
- Update Directory.Build.targets ([@matt-edmondson](https://github.com/matt-edmondson))
- Update dotnet.yml ([@matt-edmondson](https://github.com/matt-edmondson))
- Update LICENSE ([@matt-edmondson](https://github.com/matt-edmondson))
- Update nuget.config ([@matt-edmondson](https://github.com/matt-edmondson))
- Update readme ([@matt-edmondson](https://github.com/matt-edmondson))
- v1.0.0-alpha.8 ([@matt-edmondson](https://github.com/matt-edmondson))