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 |
|
Examples
The function string.contains("foobar","foo")
returns true
.