TextCase 1.0.11

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

TextCase

.NET NuGet Nuget

TextCase is a powerful .NET library designed to simplify text manipulation by providing a variety of case conversion methods.

Key Features

  • Wide Range of Conversions: Transform text into 19 different cases including UpperCase, LowerCase, TitleCase, CamelCase, PascalCase, Base64 encoding/decoding, and more.
  • Text Analysis: Easily count characters, words, letters, and sentences within your text.
  • Easy Integration: Simple and intuitive API that integrates seamlessly with your .NET applications.
  • List Available Conversions: Easily retrieve all supported text cases programmatically.

Available Conversions

  • UpperCase: Converts text to uppercase.
  • LowerCase: Converts text to lowercase.
  • TitleCase: Capitalizes the first letter of each word.
  • CamelCase: Converts text to camelCase.
  • PascalCase: Converts text to PascalCase.
  • KebabCase: Converts text to kebab-case.
  • SnackCase: Converts text to snack_case.
  • HashTagCase: Converts text to #HashTagCase.
  • ConstantCase: Converts text to CONSTANT_CASE.
  • CobolCase: Converts text to COBOL-CASE.
  • InverseCase: Alternates case starting with lowercase.
  • TrainCase: Converts text to Train-Case.
  • CapitaliseCase: Capitalizes the first letter of the text.
  • CapitaliseWordsCase: Capitalizes the first letter of each word.
  • ReverseCase: Reverses the text.
  • AlternateCase: Alternates case starting with uppercase.
  • Base64EncodeCase: Encodes text to Base64.
  • Base64DecodeCase: Decodes Base64 text.

Text Analysis Examples:

  • number of characters
  • number of words
  • number of letters
  • number of sentences
  • number of paragraphs

Usage Examples:

// YOU TALKING TO ME?
TextCase.Convert("You talking to me?", Case.UpperCase);
"You talking to me?".ToUpperCase();

// you talking to me?
TextCase.Convert("You talking to me?", Case.LowerCase);
"You talking to me?".ToLowerCase();

// You Talking To Me?
TextCase.Convert("You talking to me?", Case.TitleCase);
"You talking to me?".ToTitleCase();

// You talking to me?
TextCase.Convert("You talking to me?", Case.CapitaliseCase);   
"You talking to me?".ToCapitaliseCase();

// You Talking To Me?
TextCase.Convert("You talking to me?", Case.CapitaliseWordsCase); 
"You talking to me?".ToCapitaliseWordsCase();

// ?em ot gniklat uoY
TextCase.Convert("You talking to me?", Case.ReverseCase);         
"You talking to me?".ToReverseCase();

// YoU TaLkInG To mE?
TextCase.Convert("You talking to me?", Case.AlternateCase);       
"You talking to me?".ToAlternateCase();

// youTalkingToMe?
TextCase.Convert("You talking to me?", Case.CamelCase);           
"You talking to me?".ToCamelCase();

// YouTalkingToMe?
TextCase.Convert("You talking to me?", Case.PascalCase);          
"You talking to me?".ToPascalCase();

// you-talking-to-me?
TextCase.Convert("You talking to me?", Case.KebabCase);           
"You talking to me?".ToKebabCase();

// you_talking_to_me?
TextCase.Convert("You talking to me?", Case.SnackCase);           
"You talking to me?".ToSnackCase();

// #You #talking #to #me?
TextCase.Convert("You talking to me?", Case.HashTagCase);   
"You talking to me?".ToHashTagCase();

// YOU_TALKING_TO_ME
TextCase.Convert("You talking to me?", Case.ConstantCase);   
"You talking to me?".ToConstantCase();

// YOU-TALKING-TO-ME
TextCase.Convert("You talking to me?", Case.CobolCase);   
"You talking to me?".ToCobolCase();

// yOu TaLkInG tO mE?
TextCase.Convert("You talking to me?", Case.InverseCase);   
"You talking to me?".ToInverseCase();

// You-Talking-To-Me
TextCase.Convert("You talking to me?", Case.TrainCase);   
"You talking to me?".ToTrainCase();

// Encode text to Base64
TextCase.Convert("You talking to me?", Case.Base64EncodeCase);
"You talking to me?".ToBase64EncodeCase();

// Decode Base64 text
TextCase.Convert("WW91IHRhbGtpbmcgdG8gbWU/", Case.Base64DecodeCase);
"WW91IHRhbGtpbmcgdG8gbWU?".ToBase64DecodeCase();

Text Analysis Functions

// Text Count
TextCase.GetTextCount("You talking to me?");  
"You talking to me?".GetTextCount();  

// Words Count
TextCase.GetWordsCount("You talking to me?");
"You talking to me?".GetWordsCount();

// Letters Count
TextCase.GetLettersCount("You talking to me?");
"You talking to me?".GetLettersCount();

// Sentences Count
TextCase.GetSentencesCount("You talking to me?");
"You talking to me?".GetSentencesCount();

// Paragraphs Count
TextCase.GetParagraphsCount("You talking to me?");
"You talking to me?".GetParagraphsCount();

GetAllCases The GetAllCases method has been introduced to allow users to retrieve a complete list of all available text case conversions.

var allCases = TextCase.GetAllCases();

foreach (var textCase in allCases)
{
    Console.WriteLine(textCase);
}

Get it on NuGet:

PM> Install-Package TextCase

Feedback and Contribution

Please feel free to send in a Pull Request, or drop me an email. Cheers!

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 was computed.  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.
  • net8.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.11 206 5/27/2024
1.0.10 116 5/25/2024
1.0.9 123 5/24/2024
1.0.8 120 5/23/2024
1.0.7 106 5/12/2024
1.0.6 110 5/12/2024
1.0.5 1,011 9/13/2023
1.0.4 158 9/12/2023
1.0.3 444 4/10/2021
1.0.2 372 4/2/2021
1.0.1 358 4/2/2021
1.0.0 367 4/1/2021