String Dehumanization
October 21, 2025 ยท View on GitHub
Convert human-friendly strings back to PascalCase format.
Overview
Dehumanization reverses the humanization process, taking a humanized string and converting it back to PascalCase. This is useful when you need to convert user input or display text back into a format suitable for code identifiers.
Basic Usage
"Pascal case input string is turned into sentence".Dehumanize()
// => "PascalCaseInputStringIsTurnedIntoSentence"
"some string".Dehumanize()
// => "SomeString"
"Some String".Dehumanize()
// => "SomeString"
Behavior
The dehumanization process:
- Splits the input on spaces
- Humanizes each word (to handle edge cases)
- Pascalizes each word (capitalizing first letter)
- Removes all spaces
If the input is already in PascalCase (contains no spaces), it is returned unchanged.
Examples
"SomeStringAndAnotherString".Dehumanize()
// => "SomeStringAndAnotherString" (unchanged)
Related Topics
- String Humanization
- Inflector Methods - Pascalize, Camelize