Skip to content

Remove Last ​

Removes the last occurrence of a substring from a string.

liquid
{{ string | remove_last: substring }}

Example ​

liquid
{{ 'red-blue-red' | remove_last: 'red' }}

Output

html
red-blue-