Yoh.Text.Json.NamingPolicies
0.2.0
.NET Core 3.1
Install-Package Yoh.Text.Json.NamingPolicies -Version 0.2.0
dotnet add package Yoh.Text.Json.NamingPolicies --version 0.2.0
<PackageReference Include="Yoh.Text.Json.NamingPolicies" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Yoh.Text.Json.NamingPolicies --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yoh.Text.Json.NamingPolicies, 0.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Yoh.Text.Json.NamingPolicies as a Cake Addin
#addin nuget:?package=Yoh.Text.Json.NamingPolicies&version=0.2.0
// Install Yoh.Text.Json.NamingPolicies as a Cake Tool
#tool nuget:?package=Yoh.Text.Json.NamingPolicies&version=0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
The package provides a set of missed naming policies for the system JSON serializer in .NET.
Snake Case
Rewrites an input string changing the case of each word and connecting them using underscores. All non letter or digit characters are ignored.
namespace Yoh.Text.Json.NamingPolicies;
public static class JsonNamingPolicies
{
public static JsonNamingPolicy SnakeLowerCase { get; }
public static JsonNamingPolicy SnakeUpperCase { get; }
}
Input | Output (lower case) | Output (upper case) |
---|---|---|
XMLHttpRequest |
xml_http_request |
XML_HTTP_REQUEST |
camelCase |
camel_case |
CAMEL_CASE |
CamelCase |
camel_case |
CAMEL_CASE |
snake_case |
snake_case |
SNAKE_CASE |
SNAKE_CASE |
snake_case |
SNAKE_CASE |
kebab-case |
kebab_case |
KEBAB_CASE |
KEBAB-CASE |
kebab_case |
KEBAB_CASE |
double space |
double_space |
DOUBLE_SPACE |
double__underscore |
double_underscore |
DOUBLE_UNDERSCORE |
abc |
abc |
ABC |
abC |
ab_c |
AB_C |
aBc |
a_bc |
A_BC |
aBC |
a_bc |
A_BC |
ABc |
a_bc |
A_BC |
ABC |
abc |
ABC |
abc123def456 |
abc123def456 |
ABC123DEF456 |
abc123Def456 |
abc123_def456 |
ABC123_DEF456 |
abc123DEF456 |
abc123_def456 |
ABC123_DEF456 |
ABC123DEF456 |
abc123def456 |
ABC123DEF456 |
ABC123def456 |
abc123def456 |
ABC123DEF456 |
Abc123def456 |
abc123def456 |
ABC123DEF456 |
abc |
abc |
ABC |
abc |
abc |
ABC |
abc |
abc |
ABC |
abc def |
abc_def |
ABC_DEF |
Kebab Case
Rewrites an input string changing the case of each word and connecting them using hyphens. All non letter or digit characters are ignored.
namespace Yoh.Text.Json.NamingPolicies;
public static class JsonNamingPolicies
{
public static JsonNamingPolicy KebabLowerCase { get; }
public static JsonNamingPolicy KebabUpperCase { get; }
}
Input | Output (lower case) | Output (upper case) |
---|---|---|
XMLHttpRequest |
xml-http-request |
XML-HTTP-REQUEST |
camelCase |
camel-case |
CAMEL-CASE |
CamelCase |
camel-case |
CAMEL-CASE |
snake_case |
snake-case |
SNAKE-CASE |
SNAKE_CASE |
snake-case |
SNAKE-CASE |
kebab-case |
kebab-case |
KEBAB-CASE |
KEBAB-CASE |
kebab-case |
KEBAB-CASE |
double space |
double-space |
DOUBLE-SPACE |
double__underscore |
double-underscore |
DOUBLE-UNDERSCORE |
abc |
abc |
ABC |
abC |
ab-c |
AB-C |
aBc |
a-bc |
A-BC |
aBC |
a-bc |
A-BC |
ABc |
a-bc |
A-BC |
ABC |
abc |
ABC |
abc123def456 |
abc123def456 |
ABC123DEF456 |
abc123Def456 |
abc123-def456 |
ABC123-DEF456 |
abc123DEF456 |
abc123-def456 |
ABC123-DEF456 |
ABC123DEF456 |
abc123def456 |
ABC123DEF456 |
ABC123def456 |
abc123def456 |
ABC123DEF456 |
Abc123def456 |
abc123def456 |
ABC123DEF456 |
abc |
abc |
ABC |
abc |
abc |
ABC |
abc |
abc |
ABC |
abc def |
abc-def |
ABC-DEF |
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp3.1 |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Yoh.Text.Json.NamingPolicies:
Package | Downloads |
---|---|
OEmbed
A simple oEmbed consumer library for .NET |
GitHub repositories
This package is not used by any popular GitHub repositories.