7.5.1 ‘contains()

contains’ function can be used to check whether a list variable contains a given string. If the string is inside the list, it will return 0, otherwise 1.

# Usage
contains "$LIST" foo

contains "foo bar" foo  # Returns 0
contains "foo bar" baz  # Returns 1