Nomus is a library that allows you to detect the type of writing and convert it according to the convention you need (camelCase, PascalCase, snake_case, etc.).
$ dotnet add package Devjavu.NomusEasily convert text between different naming styles: UPPERCCASE, lowercase, PascalCase, camelCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case, UPPER-KEBAB-CASE, Title Case and Train-Case, and automatically detect the original format.
Ideal for automating naming conversions in .NET projects, code generation, migrations, tools, and utilities.
✔ Convert from any format to:
✔ Automatically detects:
✔ Correct handling of casing and separators
✔ No external dependencies (Regex only)
✔ Simple and straightforward API
dotnet add package Devjavu.Nomus
Or from Visual Studio:
Project → Manage NuGet Packages → Browse → Nomus
using Nomus;
// Detect naming style
var detected = Naming.DetectNamingStyle("votesUsers");
// "camelCase"
// PascalCase
var p = Naming.ToPascalCase("user_votes_details");
// UserVotesDetails
// camelCase
var c = Naming.ToCamelCase("UserVotesDetails");
// userVotesDetails
// snake_case
var s = Naming.ToSnakeCase("userVotesDetails");
// user_votes_details
// kebab-case
var k = Naming.ToKebabCase("userVotesDetails");
// user-votes-details
Automatically detects the naming convention of the text.
"UPPERCCASE""lowercase""PascalCase""camelCase""snake_case""SCREAMING_SNAKE_CASE""kebab-case""UPPER-KEBAB-CASE""Title Case""Train-Case""Unknown / Mixed"Naming.DetectNamingStyle("UserVotesDetails"); // PascalCase
Naming.DetectNamingStyle("userVotesDetails"); // camelCase
Naming.DetectNamingStyle("user_votes_details"); // snake_case
Naming.DetectNamingStyle("user-votes-details"); // kebab-case
Naming.DetectNamingStyle("votes UsersDetails"); // Unknown / MixedConverts from any format to UPPERCASE.
Converts from any format to lowercase.
Converts from any format to PascalCase.
Converts from any format to camelCase.
Converts from any format to snake_case.
Converts from any format to SCREAMING_SNAKE_CASE.
Converts from any format to kebab-case.
Converts from any format to UPPER-KEBAB-CASE.
Converts from any format to Title Case.
Converts from any format to Title Case.
Naming.ToPascalCase("hello-world"); // HelloWorld
Naming.ToCamelCase("HELLO_WORLD"); // helloWorld
Naming.ToSnakeCase("HelloWorld"); // hello_world
Naming.ToKebabCase("helloWorldTest"); // hello-world-test
Naming.ToTrainCase("helloWorldTest"); // Hello-World-Test
Naming.DetectNamingStyle("MyVariable"); // PascalCase
Naming.DetectNamingStyle("myVariable"); // camelCase
Naming.DetectNamingStyle("my_variable"); // snake_case
Naming.DetectNamingStyle("my-variable"); // kebab-case
Naming.DetectNamingStyle("My Variable"); // Title CaseNomus/
├── Naming.cs
├── README.md
└── Nomus.nuspec
This project is licensed under the MIT License, which means you can freely use it in commercial and personal projects.
Contributions are welcome! You can:
If this package was useful to you, consider leaving a ⭐ on GitHub or sharing it with other developers.