mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 02:40:41 -07:00
capitalize also downcases each remaining letter
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: capitalize
|
title: capitalize
|
||||||
description: Liquid filter that capitalizes the first character of a string.
|
description: Liquid filter that capitalizes the first character of a string and downcases the remaining characters.
|
||||||
---
|
---
|
||||||
|
|
||||||
Makes the first character of a string capitalized.
|
Makes the first character of a string capitalized and converts the remaining characters to lowercase.
|
||||||
|
|
||||||
<p class="code-label">Input</p>
|
<p class="code-label">Input</p>
|
||||||
```liquid
|
```liquid
|
||||||
@@ -22,11 +22,11 @@ Makes the first character of a string capitalized.
|
|||||||
<p class="code-label">Input</p>
|
<p class="code-label">Input</p>
|
||||||
```liquid
|
```liquid
|
||||||
{% raw %}
|
{% raw %}
|
||||||
{{ "my great title" | capitalize }}
|
{{ "my GREAT title" | capitalize }}
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
<p class="code-label">Output</p>
|
<p class="code-label">Output</p>
|
||||||
```text
|
```text
|
||||||
{{ "my great title" | capitalize }}
|
{{ "my GREAT title" | capitalize }}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user