Intialize array by splitting a string - tried but no success

Topic summary

A user encountered a Liquid syntax error when attempting to initialize an array by splitting a string. The problematic code used split "," without a colon.

Original Code:

  • {%- assign altlangs0 = "en,nl" -%}
  • {%- assign altlangs = altlangs0 | split "," -%}

Error Message:
Liquid syntax error indicating “Expected end_of_string but found string in…”

Resolution:
The user identified the issue themselves—missing a colon in the split filter syntax. The correct syntax should be split: "," instead of split ",". After adding the colon, the code worked as expected according to the Shopify Liquid documentation.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Dear Shopify experts,

I try initialising an array by splitting a string using these two lines of liquid:

{%- assign altlangs0 = “en,nl” -%}
{%- assign altlangs = altlangs0 | split “,” -%}

I can save the snippet, but when I run it I see this error message in the output:

Liquid syntax error (snippets/wk-translate-metafield line 2): Expected end_of_string but found string in “{{altlangs0 | split “,” }}”

I try to follow the example found in the manual over here:

https://shopify.dev/docs/api/liquid/filters/split

What am I doing wrong? Sorry for the newbe question and thanks for the help.

With best regards,

M. Hennekam

Ikes! It seems I missed the colon in the example!

It does what it promises by now.