SachiDev.StringUtilities
1.0.1
dotnet add package SachiDev.StringUtilities --version 1.0.1
NuGet\Install-Package SachiDev.StringUtilities -Version 1.0.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="SachiDev.StringUtilities" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SachiDev.StringUtilities" Version="1.0.1" />
<PackageReference Include="SachiDev.StringUtilities" />
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 SachiDev.StringUtilities --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SachiDev.StringUtilities, 1.0.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.
#:package SachiDev.StringUtilities@1.0.1
#: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=SachiDev.StringUtilities&version=1.0.1
#tool nuget:?package=SachiDev.StringUtilities&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SachiDev.StringUtilities
A high-performance, lightweight utility library providing advanced string extension methods for modern .NET 10 applications. This package simplifies everyday string tasks like text manipulation, data masking, and SEO formatting.
What This Library Does
This library exposes a set of extension methods on the standard string type to perform common, repetitive text operations without polluting your application logic.
1. Accurate Word Counting (WordCount)
- What it does: Counts the exact number of words in a text block.
- How it works: It strips out messy formatting such as tabs (
\t), carriage returns (\r), newlines (\n), and multiple consecutive spaces, ensuring an accurate count where standard splitting fails. - Behavior with empty text: Safely returns
0if the text is null, empty, or only contains whitespace.
2. SEO-Friendly URL Generation (ToUrlSlug)
- What it does: Transforms human-readable titles into clean, web-safe URL paths (slugs).
- How it works: It converts all text to lowercase, strips out illegal characters and punctuation (like
!,@,#,?), and replaces spaces or duplicate hyphens with a single, clean hyphen (-).
3. Sensitive Data Masking (Mask)
- What it does: Shields sensitive strings—like API keys, passwords, or credit card numbers—before displaying them in logs or user interfaces.
- How it works: It measures the total length of the string, replaces the majority of the starting characters with a masking symbol (default is
*), and preserves only a specified number of safe trailing characters at the end.
4. Cultural Text Formatting (ToTitleCase)
- What it does: Automatically formats poorly cased strings into clean Title Case (capitalizing the first letter of each word).
- How it works: To prevent acronyms or existing uppercase words from being skipped, it lowercases the entire string first and then applies the casing rules tied directly to the system's current culture settings.
Technical Specifications
- Target Framework: .NET 10.0 (Long Term Support)
- Language Version: C# 14
- Dependencies: None (Zero external dependencies for maximum performance and security)
- IntelliSense Support: Full XML Documentation embedded inside the package for hover summaries during development.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- 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.0.1 | 92 | 5/16/2026 |