String.includes(search) Last updated: 13. Nov 2023
The includes() method returns true if a string contains a specified string.
Parameters
Name | Type | Description |
---|---|---|
search | string | The value to search for |
Returns
True if search string is found otherwise false.
Example
Code example (#JS)
#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.#{
let text = "Hello world";
let result = text.includes("world");
write(result);
}#
Output
The #JS code above produces the output shown below:True