Choose where you’d like to start

contains()

Overview

The contains() function takes listVariable and searchElement as arguments. It returns true if listVariable contains the searchElement. Otherwise, returns false.

Return Type

  • Boolean

Syntax

<variable> = <listVariable>.contains( <searchElement> );
ParameterDescriptionData type
<variable>Variable which will contain the returned boolean value.BOOLEAN
<listVariable>The list variable in which the element will be searched for.LIST
<searchElement>The element to be searched for in the list variable.ALL DATA TYPES

Examples

listVar = {1, "2", "Zoho", "Creator", {"version":5}, {"India", "USA", "Australia"}};
a = listVar.contains("1");                            //returns false        
b = listVar.contains(2);                             //returns false
c = listVar.contains("zoho");                    //returns false
d = listVar.contains("Creator");                //returns true
e = listVar.contains("version");                 //returns false
f = listVar.contains({"Version" : 5});           //returns false
g = listVar.contains({"India"});                   //returns false

Get Started Now

Execute