slice
Part of a string or array, from an index and a length.
Negative indexes count from the end. The length defaults to 1.
Syntax
Section titled “Syntax”string | slice: start, lengthParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
start (required) |
number | First index (0-based; negative from the end). |
length |
number | How many characters or items (default 1). |
Returns
Section titled “Returns”string or array
Example
Section titled “Example”{{ 'Sooquna' | slice: 0, 4 }} {{ 'Sooquna' | slice: -3, 3 }}Sooq unaCompatibility
Section titled “Compatibility”Shopify: Same as Shopify.
Since theme platform 1.0.
Was this page helpful?

