ktsu.Extensions 1.3.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package ktsu.Extensions --version 1.3.1                
NuGet\Install-Package ktsu.Extensions -Version 1.3.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="ktsu.Extensions" Version="1.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.Extensions --version 1.3.1                
#r "nuget: ktsu.Extensions, 1.3.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 ktsu.Extensions as a Cake Addin
#addin nuget:?package=ktsu.Extensions&version=1.3.1

// Install ktsu.Extensions as a Cake Tool
#tool nuget:?package=ktsu.Extensions&version=1.3.1                

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

NuGet packages (7)

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 589 1/2/2025
1.3.2-pre.18 27 1/20/2025
1.3.2-pre.17 30 1/18/2025
1.3.2-pre.16 30 1/16/2025
1.3.2-pre.15 7 1/14/2025
1.3.2-pre.14 27 1/13/2025
1.3.2-pre.13 28 1/11/2025
1.3.2-pre.12 22 1/10/2025
1.3.2-pre.11 28 1/10/2025
1.3.2-pre.10 8 1/8/2025
1.3.2-pre.9 40 1/7/2025
1.3.2-pre.8 46 1/6/2025
1.3.2-pre.7 60 1/4/2025
1.3.2-pre.6 47 1/3/2025
1.3.2-pre.5 49 1/3/2025
1.3.2-pre.4 47 1/3/2025
1.3.2-pre.3 63 1/1/2025
1.3.2-pre.2 69 12/31/2024
1.3.2-pre.1 52 12/29/2024
1.3.1 755 12/28/2024
1.3.0 77 12/28/2024
1.2.16-pre.3 43 12/28/2024
1.2.16-pre.2 46 12/27/2024
1.2.16-pre.1 47 12/27/2024
1.2.15-pre.1 47 12/27/2024
1.2.14 531 12/26/2024
1.2.13 83 12/26/2024
1.2.12 81 12/26/2024
1.2.11 80 12/26/2024
1.2.10 81 12/26/2024
1.2.10-pre.1 46 12/27/2024
1.2.9 83 12/26/2024
1.2.8 911 12/26/2024
1.2.7 1,241 12/24/2024
1.2.6 480 12/23/2024
1.2.5 79 12/23/2024
1.2.4 433 12/22/2024
1.2.3 98 12/22/2024
1.2.2 133 12/22/2024
1.2.1 144 12/22/2024
1.2.0 619 12/19/2024
1.1.0 82 12/19/2024
1.0.37 525 12/13/2024
1.0.36 659 12/5/2024
1.0.35 335 12/4/2024
1.0.34 448 12/2/2024
1.0.33 85 12/2/2024
1.0.32 287 12/2/2024
1.0.31 414 12/1/2024
1.0.30 221 12/1/2024
1.0.29 84 12/1/2024
1.0.28 151 11/30/2024
1.0.27 266 11/28/2024
1.0.26 300 11/26/2024
1.0.25 927 11/14/2024
1.0.24 313 11/13/2024
1.0.23 809 11/2/2024
1.0.22 363 11/1/2024
1.0.21 1,050 10/16/2024
1.0.20 679 10/5/2024
1.0.19 223 10/4/2024
1.0.18 769 9/21/2024
1.0.17 273 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 444 9/14/2024
1.0.7 122 9/14/2024

##