asserts.containsAny(text, patterns)
[res, msg] = asserts.containsAny(text, patterns)
| Parameter | Description |
|---|---|
| text | Character vector or string scalar to test. |
| patterns | Character vector, string scalar, string array or cell of character vectors. At least one pattern must be present. |
| Parameter | Description |
|---|---|
| res | true if the assertion passes, false otherwise. |
| msg | assertion failure message, empty on success. |
The assertion passes when at least one pattern is found in text.
Use asserts.containsAll when every pattern must match.
asserts.containsAny('Nelson language', {'toolbox', 'Nelson'});
[res, msg] = asserts.containsAny('Nelson language', {'toolbox', 'module'});
| Version | Description |
|---|---|
| 2.0.0 | initial version |