Function title

Source
pub fn title(s: impl Display) -> Result<String, Error>
Expand description

Return a title cased version of the value. Words will start with uppercase letters, all remaining characters are lowercase.

/// ```jinja
/// <div>{{ example|title }}</div>
/// ```
#[derive(Template)]
#[template(ext = "html", in_doc = true)]
struct Example<'a> {
    example: &'a str,
}

assert_eq!(
    Example { example: "hello WORLD" }.to_string(),
    "<div>Hello World</div>"
);