replace_first

replace_first仅使用第二个参数替换字符串中第一个参数的第一个参数。

输入

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

输出

Take your protein pills and put my helmet on