replace_first替换第一个匹配项
ZKEASOFT August 28, 2018
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