@str.includes
Check whether a string contains a substring.
Returns: bool
Syntax
Section titled “Syntax”@str.includes(value item)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value |
string |
Input value |
item |
string |
Substring to search for |
Examples
Section titled “Examples”# Check if string contains substringprint @str.includes("hello world" "world")
# Check for missing substringprint @str.includes("hello world" "xyz")See Also
Section titled “See Also”- @str.replace — find and replace
- @includes — array membership check