SharperHacks.CoreLibs.StringExtensions
6.0.0
Prefix Reserved
This package has a SemVer 2.0.0 package version: 6.0.0+2026.02.02.JwD.b7cd15c.
dotnet add package SharperHacks.CoreLibs.StringExtensions --version 6.0.0
NuGet\Install-Package SharperHacks.CoreLibs.StringExtensions -Version 6.0.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="SharperHacks.CoreLibs.StringExtensions" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharperHacks.CoreLibs.StringExtensions" Version="6.0.0" />
<PackageReference Include="SharperHacks.CoreLibs.StringExtensions" />
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 SharperHacks.CoreLibs.StringExtensions --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SharperHacks.CoreLibs.StringExtensions, 6.0.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.
#:package SharperHacks.CoreLibs.StringExtensions@6.0.0
#: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=SharperHacks.CoreLibs.StringExtensions&version=6.0.0
#tool nuget:?package=SharperHacks.CoreLibs.StringExtensions&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

StringExtensions Library for .NET
SharperHacks.CoreLibs.StringExtensions
Some useful string extensions.
Licensed under the Apache License, Version 2.0. See LICENSE.
Contact: joseph@sharperhacks.org
Nuget: https://www.nuget.org/packages/SharperHacks.CoreLibs.Constraints
Targets
- net8.0
- net9.0
- net10.0
Classes
StringExtensions
Static class implementing static string extension methods:
/// Determines whether any of the elements in values exists in str (no LINQ).
public static bool ContainsAny(this string str, params char[] values) ...
public static bool ContainsAny(this string str, ImmutableHashSet<char> values) ...
public static bool ContainsAny(this string str, params string[] values) ...
/// Determines where any of the elements str, are whitespace.
public static bool HasWhiteSpace(this string str) ...
/// Determines whether a string is a member of strings.
public static bool In(
this string str,
IEnumerable<string> strings,
IEqualityComparer<string>? comparer = default) ...
public static bool In(this string str, HashSet<string> strings) ...
/// Determines whether dictionary contains key and/or a key that match
public static bool InDictionary(
this string str,
IDictionary<string, string> dictionary,
bool matchWholeKey = true,
bool matchWholeValue = true) ...
public static bool InKeys<Tv>(
this string str,
IDictionary<string, Tv> dictionary) ...
public static bool InValues<Tk>(
this string str,
IDictionary<Tk, string> dictionary,
bool matchWholeValue = true) ...
/// Determine if string contains only decimal digits.
public static bool IsAllDecimalDigits(this string str) ...
/// Determine if string contains only hex digits (case insensitive).
public static bool IsAllHexDigits(this string str, bool prefixRequired = false) ...
/// Determine whether the string contains only the characters in the specified set.
public static bool IsLimitedToSetOf(this string str, ImmutableHashSet<char> set) ...
/// Determines whether the string contains only the characters in the specified interval.
public static bool IsLimitedToRange(this string str, IInterval<char> range) ...
/// Determines whether a string can be used as a file name.
public static bool IsValidFileName(this string str) ...
/// Determines whether a string can be used as a directory name.
public static bool IsValidDirectoryName(this string str) ...
/// Determines whether the string is all white space.
public static bool IsWhiteSpace(this string str) ...
/// Determine whether str is not a member of strings.
public static bool NotIn(
this string str,
IEnumerable<string> strings,
IEqualityComparer<string>? comparer = default) ...
public static bool NotIn(this string str, HashSet<string> strings) ...
/// Determines whether dictionary does not contain key and/or a key that match
public static bool NotInDictionary(
this string str,
IDictionary<string, string> dictionary,
bool matchWholeKey = true,
bool matchWholeValue = true) ...
public static bool NotInKeys<Tv>(
this string str,
IDictionary<string, Tv> dictionary) ...
public static bool NotInValues<Tk>(
this string str,
IDictionary<Tk, string> dictionary,
bool matchWholeValue = true) ...
/// Convert a string representation of an encoding to the appropriate Encoding type.
public static Encoding ToEncoding(this string str) ...
| 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. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- SharperHacks.CoreLibs.Constants (>= 5.1.0)
- SharperHacks.CoreLibs.Constraints (>= 5.1.0)
- SharperHacks.CoreLibs.Math (>= 5.0.0)
-
net8.0
- SharperHacks.CoreLibs.Constants (>= 5.1.0)
- SharperHacks.CoreLibs.Constraints (>= 5.1.0)
- SharperHacks.CoreLibs.Math (>= 5.0.0)
-
net9.0
- SharperHacks.CoreLibs.Constants (>= 5.1.0)
- SharperHacks.CoreLibs.Constraints (>= 5.1.0)
- SharperHacks.CoreLibs.Math (>= 5.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on SharperHacks.CoreLibs.StringExtensions:
| Package | Downloads |
|---|---|
|
SharperHacks.CoreLibs.AppUtilities
Some useful bits for applications. |
|
|
SharperHacks.CoreLibs.CommandLineInterface
Command line parser. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.0 | 50 | 2/3/2026 |
| 5.2.2 | 91 | 12/16/2025 |
| 5.2.1 | 138 | 11/11/2025 |
| 5.2.0 | 69 | 11/5/2025 |
| 5.1.0 | 75 | 11/4/2025 |
| 5.0.3 | 68 | 10/13/2025 |
| 5.0.2 | 85 | 10/13/2025 |
| 5.0.1 | 93 | 10/11/2025 |
| 5.0.0 | 107 | 8/21/2025 |
| 4.0.2 | 86 | 7/18/2025 |
| 4.0.1 | 63 | 7/18/2025 |
| 4.0.0 | 143 | 5/19/2025 |
| 3.4.0 | 79 | 5/9/2025 |
| 3.3.0 | 132 | 4/5/2025 |
| 3.2.3 | 278 | 1/29/2025 |
| 3.2.2 | 114 | 12/20/2024 |
| 3.2.1 | 99 | 12/20/2024 |
| 3.2.0 | 119 | 11/26/2024 |
| 3.0.1 | 108 | 10/13/2024 |
| 3.0.0 | 114 | 7/11/2024 |
| 2.0.0 | 128 | 1/27/2024 |
| 1.0.1 | 102 | 10/13/2024 |
| 1.0.0 | 193 | 11/30/2023 |