asserts.startsWith(text, prefix)
[res, msg] = asserts.startsWith(text, prefix)
| Parameter | Description |
|---|---|
| text | Character vector or string scalar to test. |
| prefix | Expected prefix. |
| Parameter | Description |
|---|---|
| res | true if the assertion passes, false otherwise. |
| msg | assertion failure message, empty on success. |
The assertion passes when text begins with prefix.
With outputs, a missing prefix is returned as an assertion failure.
asserts.startsWith('Nelson language', 'Nelson');
[res, msg] = asserts.startsWith('Nelson language', 'language');
| Version | Description |
|---|---|
| 2.0.0 | initial version |