stencilproject/Stencil

Check if array contains string

dillan opened this issue · 1 comments

How would you suggest checking to see if an array contains a string. For example:

struct Provider: Codable {
	let items: [String]
	let selectedItems: [String]
}

{% for item in provider.items %}
	{% if provider.selectedItems contains item %}
		{{ item }} contained.
	{% else %}
		{{ item }} not contained.
	{% endif %}
{% endfor %}
{% if variable in variablesArray %}
{% endif %}