ktsu.CaseConverter
1.9.2
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.CaseConverter --version 1.9.2
NuGet\Install-Package ktsu.CaseConverter -Version 1.9.2
<PackageReference Include="ktsu.CaseConverter" Version="1.9.2" />
<PackageVersion Include="ktsu.CaseConverter" Version="1.9.2" />
<PackageReference Include="ktsu.CaseConverter" />
paket add ktsu.CaseConverter --version 1.9.2
#r "nuget: ktsu.CaseConverter, 1.9.2"
#:package ktsu.CaseConverter@1.9.2
#addin nuget:?package=ktsu.CaseConverter&version=1.9.2
#tool nuget:?package=ktsu.CaseConverter&version=1.9.2
ktsu.CaseConverter
A library with extension methods to convert strings between common casings used in code.
Introduction
CaseConverter is a lightweight .NET library that provides a set of extension methods for converting strings between various case styles commonly used in programming. Whether you need to transform identifiers between different naming conventions or format text for display, CaseConverter makes these operations simple and efficient.
Features
- ToTitleCase: Converts text to Title Case (Each Word Capitalized)
- ToPascalCase: Converts text to PascalCase (CapitalizedWords)
- ToCamelCase: Converts text to camelCase (firstWordLowerCaseRestCapitalized)
- ToSnakeCase: Converts text to snake_case (lowercase_with_underscores)
- ToKebabCase: Converts text to kebab-case (lowercase-with-hyphens)
- ToMacroCase: Converts text to MACRO_CASE (UPPERCASE_WITH_UNDERSCORES)
- ToUppercaseFirstChar: Converts only the first character to uppercase (Uppercasefirstchar)
- ToLowercaseFirstChar: Converts only the first character to lowercase (lowercaseFirstChar)
Installation
Package Manager Console
Install-Package ktsu.CaseConverter
.NET CLI
dotnet add package ktsu.CaseConverter
Package Reference
<PackageReference Include="ktsu.CaseConverter" Version="x.y.z" />
Usage Examples
Basic Example
using ktsu.CaseConverter;
string original = "This is a test string";
// Convert to different cases
string pascalCase = original.ToPascalCase(); // "ThisIsATestString"
string camelCase = original.ToCamelCase(); // "thisIsATestString"
string snakeCase = original.ToSnakeCase(); // "this_is_a_test_string"
string kebabCase = original.ToKebabCase(); // "this-is-a-test-string"
string macroCase = original.ToMacroCase(); // "THIS_IS_A_TEST_STRING"
Console.WriteLine(pascalCase);
Console.WriteLine(camelCase);
Console.WriteLine(snakeCase);
Console.WriteLine(kebabCase);
Console.WriteLine(macroCase);
Advanced Usage
// Working with code identifiers
string variableName = "customer_order_details";
string className = variableName.ToPascalCase(); // "CustomerOrderDetails"
string propertyName = variableName.ToCamelCase(); // "customerOrderDetails"
string constantName = variableName.ToMacroCase(); // "CUSTOMER_ORDER_DETAILS"
// Handling acronyms and special cases
string withAcronym = "API_response_URL";
string pascalWithAcronym = withAcronym.ToPascalCase(); // "ApiResponseUrl"
// Adjacent one-letter words fold together, so the output converts back to itself
string coords = "vector x y".ToPascalCase(); // "VectorXy", not "VectorXY"
string folded = "vector_x_y".ToPascalCase().ToSnakeCase(); // "vector_xy"
// So does a two-letter word ending in "s" after a one-letter word, which would otherwise read back as a plural acronym
string timeout = "wait n ms".ToPascalCase(); // "WaitNms", not "WaitNMs"
// First character transformations
string sentence = "lorem ipsum dolor sit amet";
string capitalized = sentence.ToUppercaseFirstChar(); // "Lorem ipsum dolor sit amet"
API Reference
Extension Methods
| Method | Parameters | Return Type | Description |
|---|---|---|---|
ToTitleCase() |
None | string |
Converts string to Title Case |
ToPascalCase() |
None | string |
Converts string to PascalCase |
ToCamelCase() |
None | string |
Converts string to camelCase |
ToSnakeCase() |
None | string |
Converts string to snake_case |
ToKebabCase() |
None | string |
Converts string to kebab-case |
ToMacroCase() |
None | string |
Converts string to MACRO_CASE |
ToUppercaseFirstChar() |
None | string |
Capitalizes only the first character |
ToLowercaseFirstChar() |
None | string |
Makes only the first character lowercase |
Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure to update tests as appropriate and adhere to the existing coding style.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ktsu.CaseConverter:
| Package | Downloads |
|---|---|
|
ktsu.AppDataStorage
A .NET library for persistent application data storage using JSON serialization. Provides a simple inherit-and-use pattern with automatic file management, thread-safe operations, debounced saves, backup recovery, and singleton access. Stores data in the user's app data folder with support for custom subdirectories and file names. |
|
|
ktsu.ImGui.Popups
A professional library for modal dialogs and popup components in ImGui.NET, providing message boxes, input prompts with validation (string, int, float), searchable selection lists with type-safe generics, and an advanced filesystem browser with open/save modes, directory navigation, and pattern filtering support. |
|
|
ktsu.ImGuiWidgets
A library of custom widgets using ImGui.NET and utilities to enhance ImGui-based applications. |
|
|
ktsu.ImGuiCredentialPopups
A .NET library providing ready-made Dear ImGui modal dialogs for collecting credentials. Ships username/password and token popups built on a shared CredentialPopup base, with masked input, automatic keyboard focus, and confirmation callbacks that hand back a ktsu.CredentialCache credential ready to store or use. |
|
|
ktsu.ImGuiPopups
A library for custom popups using ImGui.NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.5 | 756 | 11/13/2026 |
| 1.9.5-pre.1 | 71 | 11/12/2026 |
| 1.9.4 | 1,152 | 11/11/2026 |
| 1.9.3 | 106 | 11/11/2026 |
| 1.9.2 | 102 | 11/11/2026 |
| 1.9.1 | 7,652 | 10/9/2026 |
| 1.9.0 | 120 | 10/9/2026 |
| 1.8.9 | 263 | 10/9/2026 |
| 1.8.9-pre.1 | 80 | 10/8/2026 |
| 1.8.8 | 3,935 | 10/6/2026 |
| 1.8.7 | 122 | 10/6/2026 |
| 1.8.6 | 125 | 10/6/2026 |
| 1.8.5 | 1,842 | 9/29/2026 |
| 1.8.4 | 119 | 9/29/2026 |
| 1.8.3 | 778 | 9/29/2026 |
| 1.8.2 | 4,352 | 9/28/2026 |
| 1.8.1 | 147 | 9/28/2026 |
| 1.8.0 | 130 | 9/27/2026 |
| 1.7.0 | 137 | 9/27/2026 |
| 1.6.0 | 137 | 9/26/2026 |
## v1.9.2 (patch)
Changes since v1.9.1:
- Keep letter numbers such as Roman numerals, and split them like digits [patch] (#164) (matt-edmondson)
- Keep a contraction's plural after a capital run in one word [patch] (#169) (matt-edmondson)
- Split an uppercase letter with no lowercase form off the acronym it ends [patch] (#170) (matt-edmondson)
- Lower a capital whose word has no other cased letter after a one-letter word [patch] (#172) (matt-edmondson)
- Treat a titlecase digraph as a capital when splitting words [patch] (#158) (matt-edmondson)
- Split a capitalised word after a capital followed by ß or a ligature [patch] (#141) (matt-edmondson)
- Look past a decomposed accent when lowercasing a capital after an apostrophe [patch] (#146) (matt-edmondson)
- Start a new word at "Is" or "As" after an acronym [patch] (#157) (matt-edmondson)
- Keep a plural's "s" in the word after a digit and an apostrophe [patch] (#155) (matt-edmondson)
- Keep an all-caps possessive after a lowercased capital run in its word [patch] (#153) (matt-edmondson)
- Title-case a word-initial Armenian ligature, and step the scan by code point [patch] (#152) (matt-edmondson)
- Add CompatibilitySuppressions.xml for the Polyfill shim drift [patch] (#151) (matt-edmondson)
- Keep a zero-width joiner, non-joiner or soft hyphen inside its word [patch] (#147) (matt-edmondson)
- Keep a word-initial "ʼN" together and capitalised [patch] (#143) (matt-edmondson)
- Convert long runs of letters with no uppercase form in linear time (Claude)
- Keep a possessive after a lowercased all-caps run in the same word [patch] (Claude)
- Title-case a word that starts with a ligature or "ʼn" [patch] (Claude)
- Pull letter casing and the lowercase-run check out of ReplaceNonAlphaNumericWithSpace (Claude)
- Keep a run of capitals after a caseless letter in its word [patch] (Claude)
- Keep a lowercase letter, apostrophe and all-caps run in one word [patch] (Claude)
- Lowercase a word-final capital sigma to final sigma [patch] (Claude)
- Lowercase a two-letter "s" word after a one-letter word in Pascal and camel case [patch] (Claude)
- Split an acronym from a following decomposed accented word [patch] (Claude)
- Keep an apostrophe after a decomposed accent inside its word [patch] (Claude)