Files
liquid/_filters/capitalize.md
2021-04-28 13:43:02 -04:00

698 B

title, description
title description
capitalize Liquid filter that capitalizes the first character of a string and downcases the remaining characters.

Makes the first character of a string capitalized and converts the remaining characters to lowercase.

Input

```liquid {%- raw -%} {{ "title" | capitalize }} {% endraw %} ```

Output

```text {{ "title" | capitalize }} ```

Only the first character of a string is capitalized, so later words are not capitalized:

Input

```liquid {%- raw -%} {{ "my GREAT title" | capitalize }} {% endraw %} ```

Output

```text {{ "my GREAT title" | capitalize }} ```