Files
liquid/filters/replace_first.md
2016-04-02 18:46:32 -04:00

473 B

title
title
replace_first

Replaces only the first occurrence of the first argument in a string with the second argument.

Input

```liquid {% raw %} {% assign my_string = "Take my protein pills and put my helmet on" %} {{ my_string | replace_first: "my", "your" }} {% endraw %} ```

Output

```text {% assign my_string = "Take my protein pills and put my helmet on" %} {{ my_string | replace_first: "my", "your" }} ```