Skip to content

Size ​

Returns the number of characters in a string, or the number of items in an array. You can also use size with dot notation.

Example ​

Data
json
{
  "products": [
    {
      "title": "Hat",
      "price": 10
    },
    {
      "title": "Tee",
      "price": 25.5
    },
    {
      "title": "Cap",
      "price": 8
    }
  ]
}
liquid
{{ 'YouCan' | size }}
{{ products | size }}
{{ products.size }}

Output

html
6
3
3