inflect.Humanize
Returns the humanized version of the input with the first letter capitalized.
- Syntax
- inflect.Humanize INPUT
- Returns
- string
- Alias
- humanize
Usage
The inflect.Humanize function returns the humanized version of the input with the first letter capitalized. It replaces hyphens and underscores with spaces, and separates camel case words.
If the input is an integer or a string representation of an integer, the function returns the number with the appropriate ordinal suffix appended.
Examples
{{ inflect.Humanize "my-first-post" }} → My first post
{{ inflect.Humanize "my_first_post" }} → My first post
{{ inflect.Humanize "myFirstPost" }} → My first postConverting integers and string representations of integers:
{{ inflect.Humanize "52" }} → 52nd
{{ inflect.Humanize 103 }} → 103rdLast updated:
October 21, 2026
:
content: Apply style guide to inflect functions (727531114)
Improve this page