Working with text and numbers using Humanizer
Humanizer manipulates text in string
values, names of enum
values, dates, times, numbers, and quantities.
Working with text
The built-in string
type has methods to manipulate text like Substring
and Trim
. But there are plenty of other common manipulations that we might want to perform on text. For example:
- You might have an ugly string generated by some code and you want to make it look friendlier to display to a user. This is common with
enum
types that cannot use spaces in multi-word values. - You might build a web content management system, and when a user enters an article title, you need to convert what they enter into a format suitable for a URL path.
- You might have a long
string
value that needs to be truncated to show in the limited space of a mobile user interface.
Humanizer case transformations
Complex transformations can be performed in sequence by passing multiple Humanizer transformations...