Determines if a given string is a substring of a string.
This function does not generate a change.
str.contains(search_string)
Argument | Type | Description |
---|---|---|
search_string | str (required) | The characters to be searched for in the string. |
Returns true
if the given characters are found as a substring and otherwise false
.
This code shows an example using contains():
'the answer to life the universe and everything'.contains('life');
Return value in JSON format
true