mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Add slice method
@@ -63,6 +63,7 @@ Hello {{ 'now' | date: "%Y %h" }}
|
|||||||
* `truncatewords` - truncate a string down to x words
|
* `truncatewords` - truncate a string down to x words
|
||||||
* `prepend` - prepend a string *e.g.* `{{ 'bar' | prepend:'foo' }} #=> 'foobar'`
|
* `prepend` - prepend a string *e.g.* `{{ 'bar' | prepend:'foo' }} #=> 'foobar'`
|
||||||
* `append` - append a string *e.g.* `{{ 'foo' | append:'bar' }} #=> 'foobar'`
|
* `append` - append a string *e.g.* `{{ 'foo' | append:'bar' }} #=> 'foobar'`
|
||||||
|
* `slice` - slice a string. Takes an offset and length, *e.g.* `{{ "hello" | slice: -3, 3 }} #=> llo`
|
||||||
* `minus` - subtraction *e.g.* `{{ 4 | minus:2 }} #=> 2`
|
* `minus` - subtraction *e.g.* `{{ 4 | minus:2 }} #=> 2`
|
||||||
* `plus` - addition *e.g.* `{{ '1' | plus:'1' }} #=> '11'`, `{{ 1 | plus:1 }} #=> 2`
|
* `plus` - addition *e.g.* `{{ '1' | plus:'1' }} #=> '11'`, `{{ 1 | plus:1 }} #=> 2`
|
||||||
* `times` - multiplication *e.g* `{{ 5 | times:4 }} #=> 20`
|
* `times` - multiplication *e.g* `{{ 5 | times:4 }} #=> 20`
|
||||||
|
|||||||
Reference in New Issue
Block a user