mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 14:30:38 -07:00
docs: remove_last and replace_last
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
title: remove_last
|
||||||
|
---
|
||||||
|
|
||||||
|
{% since %}v10.2.0{% endsince %}
|
||||||
|
|
||||||
|
Removes only the last occurrence of the specified substring from a string.
|
||||||
|
|
||||||
|
Input
|
||||||
|
```liquid
|
||||||
|
{{ "I strained to see the train through the rain" | remove_last: "rain" }}
|
||||||
|
```
|
||||||
|
|
||||||
|
Output
|
||||||
|
```text
|
||||||
|
I strained to see the train through the
|
||||||
|
```
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
title: replace_last
|
||||||
|
---
|
||||||
|
|
||||||
|
{% since %}v10.2.0{% endsince %}
|
||||||
|
|
||||||
|
Replaces only the last occurrence of the first argument in a string with the second argument.
|
||||||
|
|
||||||
|
Input
|
||||||
|
```liquid
|
||||||
|
{{ "Take my protein pills and put my helmet on" | replace_last: "my", "your" }}
|
||||||
|
```
|
||||||
|
|
||||||
|
Output
|
||||||
|
```text
|
||||||
|
Take my protein pills and put your helmet on
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user