Ported: https://www.npmjs.com/package/change-case to C#
Install-Package Soltys.ChangeCase
Add using:
using Soltys.ChangeCase
Sample usage:
string camelCase = "test string".CamelCase() // camelCase => testString
string input = null;
input.SentenceCase() //=> ""
"string".SentenceCase(); //=> string
"dot.case".SentenceCase(); //=> dot case
"camelCase".SentenceCase(); //=> camel case
"HELLO WORLD!".SentenceCase("_"); //=> hello_world
"A STRING".SentenceCase(ci: CultureInfo.CreateSpecificCulture("tr")); //=> a strıng
string input = null;
input.CamelCase() //=> ""
"string".CamelCase(); //=> string
"dot.case".CamelCase(); //=> dotCase
"PascalCase".CamelCase(); //=> pascalCase
"version 1.2.10".CamelCase(); //=> version1_2_10
"STRING 1.2".CamelCase(ci: CultureInfo.CreateSpecificCulture("tr")); //=> strıng1_2
string input = null;
input.PascalCase() //=> ""
"string".PascalCase(); //=> String
"dot.case".PascalCase(); //=> DotCase
"camelCase".PascalCase(); //=> CamelCase
string input = null;
input.UpperCaseFirst() //=> ""
"string".UpperCaseFirst() //=> "String"
string input = null;
input.LowerCaseFirst() //=> ""
"STRING".LowerCaseFirst() //=> "sTRING"
string input = null;
input.ParamCase() //=> ""
"string".ParamCase(); //=> string
"sentance case".ParamCase(); //=> sentance-case
"camelCase".ParamCase(); //=> camel-case
string input = null;
input.DotCase() //=> ""
"string".DotCase(); //=> string
"sentance case".DotCase(); //=> sentance.case
"camelCase".DotCase(); //=> camel.case
string input = null;
input.SwapCase() //=> ""
"string".SwapCase(); //=> STRING
"PascalCase".SwapCase(); //=> pASCALcASE
"Iñtërnâtiônàlizætiøn".SwapCase(); //=> iÑTËRNÂTIÔNÀLIZÆTIØN
string input = null;
input.TitleCase() //=> ""
"string".TitleCase(); //=> String
"sentance case".TitleCase(); //=> Sentance Case
"camelCase".TitleCase(); //=> Camel Case
string input = null;
input.SnakeCase() //=> ""
"string".SnakeCase(); //=> string
"sentance case".SnakeCase(); //=> sentance_case
"camelCase".SnakeCase(); //=> camel_case
string input = null;
input.ConstantCase() //=> ""
"string".ConstantCase(); //=> STRING
"sentance case".ConstantCase(); //=> SENTANCE_CASE
"camelCase".ConstantCase(); //=> CAMEL_CASE