Check if array contains string
dillan opened this issue · 1 comments
dillan commented
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 %}
acecilia commented
{% if variable in variablesArray %}
{% endif %}