StringCase 0.1.0

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

StringCase NuGet Repository CI Status MIT license

This library provides some static methods of StringCase static class that convert string cases between Ada_Case, camelCase, COBOL-CASE, kebab-case, MACRO_CASE, PascalCase, snake_case, Title Case, and Train-Case. In addition, the static methods of StringCase static class: Capitalize, Lowerize, and Upperize are provided to convert string cases with a custom joiner character.

Essentially, these static methods only target ASCII uppercase and lowercase letters for capitalization. All characters other than ASCII uppercase and lowercase letters and ASCII numbers are removed as word separators.

If you want to use some symbols as separators, specify those symbols in the Separators field of an Options instance and use the 〜CaseWithOptions static methods for the desired case. If you want to retain certain symbols and use everything else as separators, specify those symbols in Keep field of an Options instance and use the 〜CaseWithOptions static methods for the desired case.

Additionally, you can specify whether to place word boundaries before and/or after non-alphabetic characters with conversion options. This can be set using the SeparateBeforeNonAlphabets and SeparateAfterNonAlphabets fields in the Options instance.

The 〜Case static methods that do not take Options as an argument only place word boundaries after non-alphabetic characters. In other words, they behave as if SeparateBeforeNonAlphabets = false and SeparateAfterNonAlphabets = true.

Install

This package can be installed from NuGet.

In your project file, write this package as a dependency.

<PackageReference Include="StringCase" Version="0.1.0" />

You can also install this package with dotnet command, as follows.

dotnet package add StringCase --version 0.1.0

Usage

The static methods of StringCase static class in this package can be executed as follows:

use StringCase;

string input = "fooBar123Baz";
string snake = StringCase.SnakeCase(input);
Console.WriteLine(snake);  // => "foo_bar123_baz"

If you want the conversion to behave differently, use 〜CaseWithOptions.

use StringCase;

string opts = new Options(true, true, null, null);
string input = "fooBar123Baz";
string snake = StringCase.SnakeCaseWithOptions(input, opts);
Console.WriteLine(snake);  // => "foo_bar_123_baz"

You can also use the static method Capitalize, Lowerize, and Upperize to convert strings into capitalized, lowercased, or uppercased words joined by a custom joiner character:

use StringCase;

string opts = new Options(true, true, null, null);
string input = "fooBar123Baz";
string output = StringCase.Capitalize(input, '.', opts);
Console.WriteLine(snake);  // => "Foo.Bar.123.Baz"

Native build

This library supports native build.

Actually test results

% ./build.sh native-test
Restore complete (0.7s)
    Determining projects to restore...
    All projects are up-to-date for restore.
  StringCase net10.0 succeeded (0.1s) → StringCase/bin/Release/net10.0/StringCase.dll
  StringCase.NativeTests net10.0 osx-x64 succeeded (1.9s) → StringCase.NativeTests/bin/Release/net10.0/osx-x64/publish/

Build succeeded in 3.6s
xUnit.net v3 In-Process Runner v4.0.1+8ed8aa354c [native/osx-x64] (.NET 10.0.12)
  Discovering: StringCase.NativeTests
  Discovered:  StringCase.NativeTests
  Starting:    StringCase.NativeTests
  Finished:    StringCase.NativeTests (ID = '7c9d899a8a0c67345e61bfa2d0a3e64e2ec5aecd11fee42f72a87286073b8916')
=== TEST EXECUTION SUMMARY ===
   StringCase.NativeTests  Total: 1737, Errors: 0, Failed: 0, Skipped: 0, Not Run: 0, Time: 0.041s

License

Copyright (C) 2026 Takayuki Sato

This program is free software under MIT License.<br> See the file LICENSE in this distribution for more details.

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 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 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.
  • net8.0

    • No dependencies.
  • 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
0.1.0 114 9/22/2026

Initial release.