https://github.com/soenneker/soenneker.utils.case
High performance case transformation utility methods
https://github.com/soenneker/soenneker.utils.case
case caseutil casing char csharp dotnet readonlyspan span string util utils
Last synced: 4 days ago
JSON representation
High performance case transformation utility methods
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.utils.case
- Owner: soenneker
- License: mit
- Created: 2026-02-20T13:50:27.000Z (19 days ago)
- Default Branch: main
- Last Pushed: 2026-02-27T06:40:19.000Z (12 days ago)
- Last Synced: 2026-02-27T11:10:30.076Z (12 days ago)
- Topics: case, caseutil, casing, char, csharp, dotnet, readonlyspan, span, string, util, utils
- Language: C#
- Homepage: https://soenneker.com
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/soenneker.utils.case/)
[](https://github.com/soenneker/soenneker.utils.case/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.utils.case/)
#  Soenneker.Utils.Case
### High performance case transformation utility methods
## Installation
```
dotnet add package Soenneker.Utils.Case
```
## Usage
```csharp
using Soenneker.Utils.Case;
```
All conversions use a single tokenizer internally, then format into the target case.
### Core methods
- `ToKebab(ReadOnlySpan)`
- `ToSnake(ReadOnlySpan)`
- `ToUpperSnake(ReadOnlySpan)`
- `ToDot(ReadOnlySpan)`
- `ToFlat(ReadOnlySpan)`
- `ToPath(ReadOnlySpan)`
- `ToSpace(ReadOnlySpan)`
- `ToTrain(ReadOnlySpan)`
- `ToPascal(ReadOnlySpan)`
- `ToCamel(ReadOnlySpan)`
- `ToTitle(ReadOnlySpan, CultureInfo? culture = null)`
- `ToTitle(string? value, CultureInfo? culture = null)`
- `NormalizeKebab(ReadOnlySpan)`
### Example
```csharp
const string input = "HTTPServer_v2 parser";
CaseUtil.ToKebab(input); // "http-server-v2-parser"
CaseUtil.ToSnake(input); // "http_server_v2_parser"
CaseUtil.ToUpperSnake(input); // "HTTP_SERVER_V2_PARSER"
CaseUtil.ToDot(input); // "http.server.v2.parser"
CaseUtil.ToFlat(input); // "httpserverv2parser"
CaseUtil.ToPath(input); // "http/server/v2/parser"
CaseUtil.ToSpace(input); // "http server v2 parser"
CaseUtil.ToTrain(input); // "HTTP-Server-V2-Parser"
CaseUtil.ToPascal(input); // "HTTPServerV2Parser"
CaseUtil.ToCamel(input); // "httpServerV2Parser"
CaseUtil.ToTitle(input); // "HTTP Server V2 Parser"
```