Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 755 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 755 Bytes

Saquib.Utils.Naming

Contains a set of strategies for altering names to a casing style. Currently supported strategies include:

  • camelCase
  • PascalCase
  • snake_case
  • kebab-case
  • Train-Case
  • Title Case
  • Sentence case

Usage

Usage is as follows:

var strategy = new PascalCaseNamingStrategy();
var canonicalName = strategy.Apply( "last_modified_date" );
Assert.Equal( "LastModifiedDate", canonicalName );

You can also use the convenience extension methods, but you will not be able to configure the applied strategies (default options are used_). The convenience functions are memoized, so they can be called repeated on the same input with no performance penalty.

var converted = "lastModifiedDate".ToKebabCase();