<commit_before><p><img src="https://raw.github.com/MehdiK/Humanizer/master/logo.png" alt="Logo" style="max-width:100%;" /></p>

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.

###Table of contents
 - [Install](#install)
 - [Features](#features)
   - [Humanize String](#humanize-string)
   - [Dehumanize String](#dehumanize-string)
   - [Transform String](#transform-string)
   - [Truncate String](#truncate-string)
   - [Format String](#format-string)
   - [Humanize Enums](#humanize-enums)
   - [Dehumanize Enums](#dehumanize-enums)
   - [Humanize DateTime](#humanize-datetime)
   - [Humanize TimeSpan](#humanize-timespan)
   - [Humanize Collections](#humanize-collections)
   - [Inflector methods](#inflector-methods)
     - [Pluralize](#pluralize)
     - [Singularize](#singularize)
     - [ToQuantity](#toquantity)
     - [Ordinalize](#ordinalize)
     - [Underscore](#underscore)
     - [Dasherize & Hyphenate](#dasherize--hyphenate)
   - [Fluent date](#fluent-date)
   - [Number to words](#number-to-words)
   - [Number to ordinal words](#number-to-ordinal-words)
   - [Roman numerals](#roman-numerals)
   - [ByteSize](#bytesize)
 - [Mix this into your framework to simplify your life](#mix-this-into-your-framework-to-simplify-your-life)
 - [How to contribute?](#how-to-contribute)
 - [Continuous Integration from TeamCity](#continuous-integration-from-teamcity)
 - [Author](#author)
 - [Main contributors](#main-contributors)
 - [License](#license)
 - [Icon](#icon)

##<a id="install">Install</a>
You can install Humanizer as [a nuget package](https://nuget.org/packages/Humanizer): `Install-Package Humanizer`

Humanizer is a Portable Class Library with support for .Net 4+, SilverLight 5, Windows Phone 8 and Win Store applications.
Also Humanizer [symbols nuget package](http://www.symbolsource.org/Public/Metadata/NuGet/Project/Humanizer) is published so you can [step through Humanizer code](http://www.symbolsource.org/Public/Home/VisualStudio) while debugging your code.

##<a id="features">Features</a>

###<a id="humanize-string">Humanize String</a>
`Humanize` string extensions allow you turn an otherwise computerized string into a more readable human-friendly one.
The foundation of this was set in the [BDDfy framework](https://github.com/TestStack/TestStack.BDDfy) where class names, method names and properties are turned into human readable sentences.

```C#
"PascalCaseInputStringIsTurnedIntoSentence".Humanize() => "Pascal case input string is turned into sentence"

"Underscored_input_string_is_turned_into_sentence".Humanize() => "Underscored input string is turned into sentence"

"Underscored_input_String_is_turned_INTO_sentence".Humanize() => "Underscored input String is turned INTO sentence"
```

Note that a string that contains only upper case letters, and consists only of one word, is always treated as an acronym (regardless of its length). To guarantee that any arbitrary string will always be humanized you must use a transform (see `Transform` method below):

```C#
// acronyms are left intact 
"HTML".Humanize() => "HTML"

// any unbroken upper case string is treated as an acronym
"HUMANIZER".Humanize() => "HUMANIZER"
"HUMANIZER".Transform(To.LowerCase | To.TitleCase) => "Humanizer"
```

You may also specify the desired letter casing:

```C#
"CanReturnTitleCase".Humanize(LetterCasing.Title) => "Can Return Title Case"

"Can_return_title_Case".Humanize(LetterCasing.Title) => "Can Return Title Case"

"CanReturnLowerCase".Humanize(LetterCasing.LowerCase) => "can return lower case"

"CanHumanizeIntoUpperCase".Humanize(LetterCasing.AllCaps) => "CAN HUMANIZE INTO UPPER CASE"
```

 > The `LetterCasing` API and the methods accepting it are legacy from V0.2 era and will be deprecated in the future. Instead of that, you can use `Transform` method explained below.<commit_msg>CS0019: Operator '|' cannot be applied to operands of type 'Humanizer.IStringTransformer' and 'Humanizer.IStringTransformer'<commit_after><p><img src="https://raw.github.com/MehdiK/Humanizer/master/logo.png" alt="Logo" style="max-width:100%;" /></p>

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.

###Table of contents
 - [Install](#install)
 - [Features](#features)
   - [Humanize String](#humanize-string)
   - [Dehumanize String](#dehumanize-string)
   - [Transform String](#transform-string)
   - [Truncate String](#truncate-string)
   - [Format String](#format-string)
   - [Humanize Enums](#humanize-enums)
   - [Dehumanize Enums](#dehumanize-enums)
   - [Humanize DateTime](#humanize-datetime)
   - [Humanize TimeSpan](#humanize-timespan)
   - [Humanize Collections](#humanize-collections)
   - [Inflector methods](#inflector-methods)
     - [Pluralize](#pluralize)
     - [Singularize](#singularize)
     - [ToQuantity](#toquantity)
     - [Ordinalize](#ordinalize)
     - [Underscore](#underscore)
     - [Dasherize & Hyphenate](#dasherize--hyphenate)
   - [Fluent date](#fluent-date)
   - [Number to words](#number-to-words)
   - [Number to ordinal words](#number-to-ordinal-words)
   - [Roman numerals](#roman-numerals)
   - [ByteSize](#bytesize)
 - [Mix this into your framework to simplify your life](#mix-this-into-your-framework-to-simplify-your-life)
 - [How to contribute?](#how-to-contribute)
 - [Continuous Integration from TeamCity](#continuous-integration-from-teamcity)
 - [Author](#author)
 - [Main contributors](#main-contributors)
 - [License](#license)
 - [Icon](#icon)

##<a id="install">Install</a>
You can install Humanizer as [a nuget package](https://nuget.org/packages/Humanizer): `Install-Package Humanizer`

Humanizer is a Portable Class Library with support for .Net 4+, SilverLight 5, Windows Phone 8 and Win Store applications.
Also Humanizer [symbols nuget package](http://www.symbolsource.org/Public/Metadata/NuGet/Project/Humanizer) is published so you can [step through Humanizer code](http://www.symbolsource.org/Public/Home/VisualStudio) while debugging your code.

##<a id="features">Features</a>

###<a id="humanize-string">Humanize String</a>
`Humanize` string extensions allow you turn an otherwise computerized string into a more readable human-friendly one.
The foundation of this was set in the [BDDfy framework](https://github.com/TestStack/TestStack.BDDfy) where class names, method names and properties are turned into human readable sentences.

```C#
"PascalCaseInputStringIsTurnedIntoSentence".Humanize() => "Pascal case input string is turned into sentence"

"Underscored_input_string_is_turned_into_sentence".Humanize() => "Underscored input string is turned into sentence"

"Underscored_input_String_is_turned_INTO_sentence".Humanize() => "Underscored input String is turned INTO sentence"
```

Note that a string that contains only upper case letters, and consists only of one word, is always treated as an acronym (regardless of its length). To guarantee that any arbitrary string will always be humanized you must use a transform (see `Transform` method below):

```C#
// acronyms are left intact 
"HTML".Humanize() => "HTML"

// any unbroken upper case string is treated as an acronym
"HUMANIZER".Humanize() => "HUMANIZER"
"HUMANIZER".Transform(To.LowerCase, To.TitleCase) => "Humanizer"
```

You may also specify the desired letter casing:

```C#
"CanReturnTitleCase".Humanize(LetterCasing.Title) => "Can Return Title Case"

"Can_return_title_Case".Humanize(LetterCasing.Title) => "Can Return Title Case"

"CanReturnLowerCase".Humanize(LetterCasing.LowerCase) => "can return lower case"

"CanHumanizeIntoUpperCase".Humanize(LetterCasing.AllCaps) => "CAN HUMANIZE INTO UPPER CASE"
```

 > The `LetterCasing` API and the methods accepting it are legacy from V0.2 era and will be deprecated in the future. Instead of that, you can use `Transform` method explained below.
{'fraction_non_alphanumeric': 0.12821807168096921, 'fraction_numerical': 0.002523977788995457, 'mean_word_length': 5.19140625, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 43, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1582452', 'n_tokens_mistral': 2579, 'n_tokens_neox': 2370, 'n_words': 685}