string.contains

This function checks whether a specified string exists within another string.

Syntax

string.contains(str1, str2)

Arguments

Argument

Type

Description

str1

string

Source string

str2

string

String to search for in the source string (str1)

Returns

Type

Description

boolean

  • True: if str2 is found within str1
  • False: if str2 is not found within str1

Examples

The function string.contains("foobar","foo") returns true.