Vishnu Vankayala
Vishnu Vankayala

Reputation: 129

Liquid syntax remove apostrophe

We are trying to solve this issue with an apostrophe in liquid syntax.

We've this value - 'products':'bags' in the variable and we would like to split it and remove the apostrophe.

{% assign values = field | remove: "'" | split: ":" %}

But this is not working.

Any help would be appreciated.

Upvotes: 1

Views: 1882

Answers (1)

Scott C Wilson
Scott C Wilson

Reputation: 20036

This looks ok to me. When I do

{% assign values = "'products':'bags' " | remove: "'" | split: ":" %}
{% for word in values %}
{{ word }}
{% endfor %}

I get

products

bags 

What did you want to be different?

Upvotes: 4

Related Questions