ALSI.CaseConversions
10.0.0
dotnet add package ALSI.CaseConversions --version 10.0.0
NuGet\Install-Package ALSI.CaseConversions -Version 10.0.0
<PackageReference Include="ALSI.CaseConversions" Version="10.0.0" />
<PackageVersion Include="ALSI.CaseConversions" Version="10.0.0" />
<PackageReference Include="ALSI.CaseConversions" />
paket add ALSI.CaseConversions --version 10.0.0
#r "nuget: ALSI.CaseConversions, 10.0.0"
#:package ALSI.CaseConversions@10.0.0
#addin nuget:?package=ALSI.CaseConversions&version=10.0.0
#tool nuget:?package=ALSI.CaseConversions&version=10.0.0
<div align="center">
ALSI.CaseConversions
Convert naming conventions without ceremony.
Small, allocation-conscious .NET string case conversion for identifiers, keys, generated names, and other ASCII-oriented application text.
</div>
ALSI.CaseConversions turns identifier-like strings into the case your boundary needs: JSON property names, route keys, generated code symbols, file names, configuration keys, and similar application text.
The public API is intentionally direct: use SnakeCase.Convert(...), KebabCase.Convert(...), PascalCase.Convert(...), and the other target-case facades without aliases, services, or setup.
using ALSI.CaseConversions;
string routeKey = KebabCase.Convert("CustomerAccountId");
string jsonName = SnakeCase.Convert("CustomerAccountId");
string typeName = PascalCase.Convert("customer_account_id");
Why Use It
<table> <tr> <td><strong>Clear API</strong></td> <td>One static facade per target case, all using <code>Convert(...)</code>.</td> </tr> <tr> <td><strong>Flexible inputs</strong></td> <td>Handles camelCase, PascalCase, snake_case, kebab-case, dot.case, spaces, uppercase runs, and digits.</td> </tr> <tr> <td><strong>Low overhead</strong></td> <td>Uses stack-allocated buffers for short inputs and shared array pool buffers for longer inputs.</td> </tr> <tr> <td><strong>No setup</strong></td> <td>No services, options objects, extension registration, or converter aliases.</td> </tr> </table>
Install
dotnet add package ALSI.CaseConversions
Package Manager Console:
Install-Package ALSI.CaseConversions
Quick Start
using ALSI.CaseConversions;
var jsonProperty = SnakeCase.Convert("CustomerAccountId");
// "customer_account_id"
var routeSegment = KebabCase.Convert("CustomerAccountId");
// "customer-account-id"
var generatedTypeName = PascalCase.Convert("customer_account_id");
// "CustomerAccountId"
Every converter follows the same naming pattern. Pick the target case first, then call Convert.
SnakeCase.Convert("HelloWorld"); // "hello_world"
CamelCase.Convert("hello-world"); // "helloWorld"
PascalCase.Convert("hello world"); // "HelloWorld"
KebabCase.Convert("XMLRequest"); // "xml-request"
DotCase.Convert("File123Name"); // "file123.name"
MacroCase.Convert("helloWorld"); // "HELLO_WORLD"
SentenceCase.Convert("hello_world"); // "hello world"
Supported Targets
| Target | API | Example |
|---|---|---|
snake_case |
SnakeCase.Convert(...) |
"CustomerId" → "customer_id" |
camelCase |
CamelCase.Convert(...) |
"customer-id" → "customerId" |
PascalCase |
PascalCase.Convert(...) |
"customer_id" → "CustomerId" |
kebab-case |
KebabCase.Convert(...) |
"CustomerId" → "customer-id" |
dot.case |
DotCase.Convert(...) |
"CustomerId" → "customer.id" |
MACRO_CASE |
MacroCase.Convert(...) |
"CustomerId" → "CUSTOMER_ID" |
Sentence Case |
SentenceCase.Convert(...) |
"CustomerId" → "Customer Id" |
Input Handling
Converters are designed for strings that already behave like identifiers or keys.
They handle:
- Existing separated text:
hello_world,hello-world,hello.world,hello world - PascalCase and camelCase inputs
- Runs of uppercase letters such as
XMLRequest - Digits inside names, for example
File123Name - Leading and trailing separators
- Empty input and null string input, which return
string.Empty
For example:
SnakeCase.Convert("PascalCaseInput"); // "pascal_case_input"
SnakeCase.Convert("camelCaseInput"); // "camel_case_input"
SnakeCase.Convert("Hello-World-Example"); // "hello_world_example"
SnakeCase.Convert("Hello.World.Example"); // "hello_world_example"
SnakeCase.Convert("File123Name"); // "file123_name"
Notes and Limits
This package is focused on ASCII identifier conversion. It is not intended to be a culture-aware natural-language casing engine.
- Inputs should be limited to characters in the
0x00to0xFFrange. - ASCII letters and digits are retained.
- Other characters are treated as delimiters or skipped according to the converter's internal character table.
- Converters are static and configuration-free by design.
Benchmarks
Public benchmark reports are checked into the repository for auditability.
Benchmarks measure the public converter methods directly. Inputs are selected outside the measured methods so the timings are focused on the package code under test.
See the latest checked-in report: reports/2026-06-13.
License
This project is licensed under the terms in LICENCE.
| Product | Versions 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 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. |
-
net10.0
- No dependencies.
-
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 |
|---|---|---|
| 10.0.0 | 137 | 6/14/2026 |
| 10.0.0-rc.27 | 60 | 7/23/2026 |
| 1.1.0 | 1,811 | 1/29/2025 |
| 1.1.0-rc.25 | 76 | 6/14/2026 |
| 1.1.0-rc.24 | 65 | 6/14/2026 |
| 1.1.0-rc.23 | 59 | 6/14/2026 |
| 1.1.0-rc.22 | 59 | 6/14/2026 |
| 1.1.0-rc.21 | 67 | 6/13/2026 |
| 1.1.0-rc.19 | 62 | 6/13/2026 |
| 1.0.0 | 531 | 8/31/2024 |
| 1.0.0-rc.17 | 171 | 1/29/2025 |
| 1.0.0-rc.16 | 142 | 9/23/2024 |
| 0.0.0-rc.8 | 167 | 8/31/2024 |
| 0.0.0-rc.7 | 145 | 8/31/2024 |