Simple.CaseConverter 1.0.6

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

Simple.CaseConverter

GitHub Repo stars
GitHub Actions Workflow Status
NuGet version
NuGet Downloads
GitHub Issues


๐Ÿš€ Overview

Simple.CaseConverter is a lightweight and efficient .NET library for converting strings between common casing styles such as camelCase, PascalCase, snake_case, kebab-case, and more.
It focuses on speed, correctness, and simplicity with zero dependencies beyond .NET.


๐Ÿ”‘ Key Features

  • ๐Ÿ”„ Supports multiple case conversions: camelCase, PascalCase, snake_case, kebab-case, and more
  • โšก Extremely fast performance with optimized algorithms
  • ๐Ÿงฉ Simple and intuitive API for easy integration
  • ๐Ÿงช Supports culture-invariant conversions and ASCII/non-ASCII characters
  • ๐Ÿ“š Well-tested with comprehensive unit tests
  • ๐Ÿ† Benchmark results showing performance advantages over similar libraries
  • ๐Ÿงฉ Compatible with .NET 8 and later

๐Ÿ“š Table of Contents

  1. Getting Started
  2. Casings Supported
  3. Examples
  4. Benchmark Results
  5. Technical Information
  6. Known Issues & Limitations
  7. Contributing
  8. License

๐Ÿšฆ Getting Started

Convert strings easily between different case styles with Simple.CaseConverter.

๐Ÿ“ฆ Installing

Add the package via NuGet:

dotnet add package Simple.CaseConverter

๐Ÿงช Usage

var camel = "hello_world".ToCamelCase();
Console.WriteLine(camel);  // Output: helloWorld

๐ŸŽฏ Casings Supported

  • camelCase
  • PascalCase
  • snake_case
  • kebab-case
  • SCREAMING_SNAKE_CASE
  • SCREAMING-KEBAB-CASE
  • Train-Case
  • Title Case
  • Sentence case
  • lowercase
  • UPPERCASE

๐Ÿ” Examples

const string example1 = "John Doe, the first";

Console.WriteLine("Example 1: \"" + example1 + "\"");
Console.WriteLine("  Camel case: " + example1 + " -> " + example1.ToCamelCase());
Console.WriteLine("  Kebab case: " + example1 + " -> " + example1.ToKebabCase());
Console.WriteLine("  Lower case: " + example1 + " -> " + example1.ToLowerCase());
Console.WriteLine("  Pascal case: " + example1 + " -> " + example1.ToPascalCase());
Console.WriteLine("  Screaming kebab case: " + example1 + " -> " + example1.ToScreamingKebabCase());
Console.WriteLine("  Screaming snake case: " + example1 + " -> " + example1.ToScreamingSnakeCase());
Console.WriteLine("  Sentence case: " + example1 + " -> " + example1.ToSentenceCase());
Console.WriteLine("  Snake case: " + example1 + " -> " + example1.ToSnakeCase());
Console.WriteLine("  Title case: " + example1 + " -> " + example1.ToTitleCase());
Console.WriteLine("  Train case: " + example1 + " -> " + example1.ToTrainCase());
Console.WriteLine("  Upper case: " + example1 + " -> " + example1.ToUpperCase());
Console.WriteLine();

const string example2 = "JaneDoe - the second";

Console.WriteLine("Example 2: \"" + example2 + "\"");
Console.WriteLine("  Camel case: " + example2 + " -> " + example2.ToCamelCase());
Console.WriteLine("  Kebab case: " + example2 + " -> " + example2.ToKebabCase());
Console.WriteLine("  Lower case: " + example2 + " -> " + example2.ToLowerCase());
Console.WriteLine("  Pascal case: " + example2 + " -> " + example2.ToPascalCase());
Console.WriteLine("  Screaming kebab case: " + example2 + " -> " + example2.ToScreamingKebabCase());
Console.WriteLine("  Screaming snake case: " + example2 + " -> " + example2.ToScreamingSnakeCase());
Console.WriteLine("  Sentence case: " + example2 + " -> " + example2.ToSentenceCase());
Console.WriteLine("  Snake case: " + example2 + " -> " + example2.ToSnakeCase());
Console.WriteLine("  Title case: " + example2 + " -> " + example2.ToTitleCase());
Console.WriteLine("  Train case: " + example2 + " -> " + example2.ToTrainCase());
Console.WriteLine("  Upper case: " + example2 + " -> " + example2.ToUpperCase());
Console.WriteLine();

Outputs:

Example 1: "John Doe, the first"
  Camel case: John Doe, the first -> johnDoeTheFirst
  Kebab case: John Doe, the first -> john-doe-the-first
  Lower case: John Doe, the first -> johndoethefirst
  Pascal case: John Doe, the first -> JohnDoeTheFirst
  Screaming kebab case: John Doe, the first -> JOHN-DOE-THE-FIRST
  Screaming snake case: John Doe, the first -> JOHN_DOE_THE_FIRST
  Sentence case: John Doe, the first -> John doe the first
  Snake case: John Doe, the first -> john_doe_the_first
  Title case: John Doe, the first -> John Doe The First
  Train case: John Doe, the first -> John-Doe-The-First
  Upper case: John Doe, the first -> JOHNDOETHEFIRST

Example 2: "JaneDoe - the second"
  Camel case: JaneDoe - the second -> janeDoeTheSecond
  Kebab case: JaneDoe - the second -> jane-doe-the-second
  Lower case: JaneDoe - the second -> janedoethesecond
  Pascal case: JaneDoe - the second -> JaneDoeTheSecond
  Screaming kebab case: JaneDoe - the second -> JANE-DOE-THE-SECOND
  Screaming snake case: JaneDoe - the second -> JANE_DOE_THE_SECOND
  Sentence case: JaneDoe - the second -> Jane doe the second
  Snake case: JaneDoe - the second -> jane_doe_the_second
  Title case: JaneDoe - the second -> Jane Doe The Second
  Train case: JaneDoe - the second -> Jane-Doe-The-Second
  Upper case: JaneDoe - the second -> JANEDOETHESECOND

โšก Benchmark Results

BenchmarkDotNet v0.13.5, Windows 11, .NET 8.0.0

Method Mean Error StdDev Median Gen0 Allocated
ToCamelCaseBenchmark 430.6 ns 7.32 ns 8.43 ns 429.5 ns 0.2275 952 B
ToPascalCaseBenchmark 491.0 ns 9.34 ns 8.73 ns 493.2 ns 0.2518 1056 B
ToSnakeCaseBenchmark 362.1 ns 5.32 ns 4.98 ns 361.6 ns 0.1526 640 B
ToKebabCaseBenchmark 364.1 ns 5.78 ns 5.40 ns 363.1 ns 0.1526 640 B
ToScreamingSnakeCaseBenchmark 366.0 ns 6.42 ns 6.01 ns 363.9 ns 0.1526 640 B
ToScreamingKebabCaseBenchmark 371.1 ns 6.89 ns 6.45 ns 373.0 ns 0.1526 640 B
ToTrainCaseBenchmark 570.8 ns 11.29 ns 12.08 ns 565.6 ns 0.2518 1056 B
ToTitleCaseBenchmark 584.6 ns 8.96 ns 8.39 ns 582.2 ns 0.2518 1056 B
ToSentenceCaseBenchmark 1,324.9 ns 26.17 ns 66.60 ns 1,294.1 ns 0.6809 2848 B
ToLowerCaseBenchmark 387.6 ns 6.60 ns 6.17 ns 386.6 ns 0.1583 664 B
ToUpperCaseBenchmark 400.6 ns 7.93 ns 12.11 ns 403.9 ns 0.1583 664 B

๐Ÿ”ฌ Technical Information

  • Optimized string manipulation algorithms with minimal allocations
  • Culture-invariant operations ensuring consistent results
  • Supports ASCII and Unicode characters correctly
  • Simple API for both specific case methods and general conversion method
  • Uses Span<char> and memory-safe code to maximize performance

๐Ÿž Known Issues & Limitations

  • Currently supports common casing styles only; custom casing styles are not supported yet
  • Some edge cases with unusual Unicode characters may not convert perfectly

๐Ÿค Contributing

Bug reports, feature requests, and pull requests are welcome!
Please open an issue or submit a PR via GitHub Issues.


๐Ÿ“„ License

This project is licensed under the MIT License.

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.  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. 
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.6 601 7/15/2025
1.0.5 238 7/15/2025