Skip to content

anthonielance/Soltys.ChangeCase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soltys.ChangeCase

Ported: https://www.npmjs.com/package/change-case to C#

Installation

  Install-Package Soltys.ChangeCase

Usage

Add using:

  using Soltys.ChangeCase

Sample usage:

  string camelCase = "test string".CamelCase() // camelCase => testString

SentenceCase()

  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

CamelCase()

  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

PascalCase()

  string input = null;
  input.PascalCase() //=> ""
  "string".PascalCase(); //=> String
  "dot.case".PascalCase(); //=> DotCase
  "camelCase".PascalCase(); //=> CamelCase

UpperCaseFirst()

  string input = null;
  input.UpperCaseFirst() //=> ""
  "string".UpperCaseFirst() //=> "String"

LowerCaseFirst()

string input = null;
input.LowerCaseFirst() //=> ""
"STRING".LowerCaseFirst() //=> "sTRING"

ParamCase()

  string input = null;
  input.ParamCase() //=> ""
  "string".ParamCase(); //=> string
  "sentance case".ParamCase(); //=> sentance-case
  "camelCase".ParamCase(); //=> camel-case

DotCase()

  string input = null;
  input.DotCase() //=> ""
  "string".DotCase(); //=> string
  "sentance case".DotCase(); //=> sentance.case
  "camelCase".DotCase(); //=> camel.case

SwapCase()

  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

TitleCase()

  string input = null;
  input.TitleCase() //=> ""
  "string".TitleCase(); //=> String
  "sentance case".TitleCase(); //=> Sentance Case
  "camelCase".TitleCase(); //=> Camel Case

SnakeCase()

  string input = null;
  input.SnakeCase() //=> ""
  "string".SnakeCase(); //=> string
  "sentance case".SnakeCase(); //=> sentance_case
  "camelCase".SnakeCase(); //=> camel_case

ConstantCase()

  string input = null;
  input.ConstantCase() //=> ""
  "string".ConstantCase(); //=> STRING
  "sentance case".ConstantCase(); //=> SENTANCE_CASE
  "camelCase".ConstantCase(); //=> CAMEL_CASE

Packages

No packages published

Languages

  • C# 99.9%
  • Batchfile 0.1%