replace_first

replace_first

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

Input

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

Output

Take your protein pills and put my helmet on

© 2005, 2006 Tobias Luetke
Licensed under the MIT License.
https://shopify.github.io/liquid/filters/replace_first/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部