StringUtils.CoreOSLabs
1.0.0
dotnet add package StringUtils.CoreOSLabs --version 1.0.0
NuGet\Install-Package StringUtils.CoreOSLabs -Version 1.0.0
<PackageReference Include="StringUtils.CoreOSLabs" Version="1.0.0" />
<PackageVersion Include="StringUtils.CoreOSLabs" Version="1.0.0" />
<PackageReference Include="StringUtils.CoreOSLabs" />
paket add StringUtils.CoreOSLabs --version 1.0.0
#r "nuget: StringUtils.CoreOSLabs, 1.0.0"
#:package StringUtils.CoreOSLabs@1.0.0
#addin nuget:?package=StringUtils.CoreOSLabs&version=1.0.0
#tool nuget:?package=StringUtils.CoreOSLabs&version=1.0.0
String Helper
A simple, lightweight utility library providing helpful string extension methods for .NET applications.
Installation
dotnet add package StringUtils.CoreOSLabs
Features
- String Validation: Check for blank/null/empty strings
- Text Transformation: Convert to title case, reverse strings
- Text Analysis: Count words in strings
- Text Manipulation: Truncate strings with ellipsis
- Zero Dependencies: Pure .NET Standard library
Quick Start
using StringUtils.CoreOSLabs;
// Check if string is blank
string text = " ";
bool isBlank = text.IsBlank(); // true
// Convert to title case
string title = "hello world".ToTitleCase(); // "Hello World"
// Reverse a string
string reversed = "hello".Reverse(); // "olleh"
// Count words
int words = "This is a test".WordCount(); // 4
// Truncate long text
string longText = "This is a very long string";
string truncated = longText.Truncate(15); // "This is a ve..."
API Reference
IsBlank
Checks if a string is null, empty, or whitespace.
bool result = " ".IsBlank(); // true
IsNotBlank
Checks if a string has content (not null, empty, or whitespace).
bool result = "Hello".IsNotBlank(); // true
ToTitleCase
Converts string to title case (first letter of each word uppercase).
string result = "hello world".ToTitleCase(); // "Hello World"
Reverse
Reverses the characters in a string.
string result = "hello".Reverse(); // "olleh"
WordCount
Counts the number of words in a string.
int result = "Hello world!".WordCount(); // 2
Truncate
Truncates a string to specified length with ellipsis.
string result = "This is long".Truncate(10); // "This is..."
Examples
Basic Usage
using StringUtils.CoreOSLabs;
var userInput = " ";
if (userInput.IsBlank())
{
Console.WriteLine("Please enter a value");
}
var blogTitle = "my awesome blog post";
var formattedTitle = blogTitle.ToTitleCase(); // "My Awesome Blog Post"
var longDescription = "This is a very long description that needs to be shortened";
var shortDescription = longDescription.Truncate(50);
// "This is a very long description that needs to b..."
Real-world Scenario
public class BlogPost
{
public string Title { get; set; }
public string Content { get; set; }
public string GetExcerpt(int maxLength = 100)
{
return Content.Truncate(maxLength);
}
public bool IsValid()
{
return Title.IsNotBlank() && Content.IsNotBlank();
}
public string GetFormattedTitle()
{
return Title.ToTitleCase();
}
}
Supported Platforms
- .NET 9.0+
- .NET 8.0
- .NET 6.0
- .NET Standard 2.1
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
Changelog
v1.0.0
- Initial release
- Added basic string extension methods
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.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.0 | 415 | 11/19/2025 |