TextUtilities 1.0.0

dotnet add package TextUtilities --version 1.0.0
                    
NuGet\Install-Package TextUtilities -Version 1.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="TextUtilities" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TextUtilities" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TextUtilities" />
                    
Project file
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 TextUtilities --version 1.0.0
                    
#r "nuget: TextUtilities, 1.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.
#addin nuget:?package=TextUtilities&version=1.0.0
                    
Install TextUtilities as a Cake Addin
#tool nuget:?package=TextUtilities&version=1.0.0
                    
Install TextUtilities as a Cake Tool

TextUtilities

NuGet License: MIT

A simple yet useful .NET library for common text operations.
Created as a learning project and published as a reusable utility package.


✨ Features

TextUtilities currently includes the following string-related methods:

  • NormalizeSpaces(string input)
    Removes extra spaces from a text and replaces them with single spaces.
    Example: " This is a test ""This is a test"

  • ToTitleCase(string input)
    Converts the first letter of each word to uppercase.
    Example: "hello world""Hello World"

  • IsNumeric(string input)
    Checks whether a string contains only numeric characters.
    Example: "123"true | "abc123"false


🔸Using .NET CLI:

dotnet add package TextUtilities

⚙️ Installation

You can install the package via NuGet:

🔸 Using Package Manager:

Install-Package TextUtilities

using System;
using TextUtilities;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("=== NormalizeSpaces ===");
        string messy = " This   is   a   test ";
        Console.WriteLine(TextHelper.NormalizeSpaces(messy)); // Output: This is a test

        Console.WriteLine("\n=== ToTitleCase ===");
        string text = "salam hamed";
        Console.WriteLine(TextHelper.ToTitleCase(text)); // Output: Salam Hamed

        Console.WriteLine("\n=== IsNumeric ===");
        Console.WriteLine(TextHelper.IsNumeric("123"));     // Output: True
        Console.WriteLine(TextHelper.IsNumeric("hamed"));   // Output: False
    }
}

🛠 Target Framework

.NET 9

📦 NuGet Package

🔗 https://www.nuget.org/packages/TextUtilities/

📄 License

This project is licensed under the MIT License — free for personal and commercial use. See the LICENSE file for more details.

👤 Author

Created with ❤️ by Hamed Heydarian GitHub: https://github.com/hheydarian

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