Creator Help


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


The contains function checks whether the main string string1 contains the substring string2.  This function performs a case-sensitive search.




contains(string1 , string2)  
// This format is not supported in Script builder. Use free-flow scripting mode. 

The contains function syntax has the following arguments.

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

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

Return Value

Returns true if string2 parameter occurs within the main string, otherwise false.


str1="Testing String";


str1.contains(str2); // returns true

str1.contains(" ");   // returns true 

str1.contains("test ");        // returns false

str1="Testing String";


contains(str1,str2);        // returns true

contains(str1, " ");        // returns true

contains(str1, "test ");        // returns false

Related Function

Function Description
containsIgnoreCase (str1 , str2) Returns true if first argument string contains the second argument string, otherwise false. While doing search it ignores the case. 
notContains (str1 , str2)  Returns true if first argument string does not contain the second argument string, otherwise false.