List Function - contains

This topic describes the syntax and usage of the list - contains function in Zoho Creator .


The List - contains function determines whether an element is present in the List.


list.contains(str1 , str2)

The contains function syntax has the following arguments.

str1 - Required. The main string from which you what to find the search string.

str2 - Required.  The string to be searched for within the main string.

Return Value

Returns true if element is present in the list, otherwise false. 


colors = {"Red", "Blue", "Green", "Yellow"};
if (colors.contains("Red"))