Algosim documentation: StringContains

StringContains

Tests if a string contains a given substring.

Syntax

Description

If s and x are strings, then StringContains returns true iff s contains x as a substring, subject to any additional restrictions imposed by the remaining arguments.

f specifies flags for the algorithm. It is a string that can contain zero or more of the following characters:

If omitted, f defaults to "" (no options).

Finally, if δ is specified, StringContains will begin searching s for x at character index δ in s (the first character having index 1).

Examples

StringContains("Nargles can be somewhat obnoxious creatures at times.", "nargle")
false
StringContains("Nargles can be somewhat obnoxious creatures at times.", "nargle", "i")
true
StringContains("Nargles can be somewhat obnoxious creatures at times.", "nargle", "iw")
false
Alice ≔ ExampleData("Alice in Wonderland");
StringContains(Alice, "dinner", "iw")
true
StringContains(Alice, "pyruvate dehydrogenase complex", "iw")
false