ring/contains.html">String.contains</a>):</p>
<pre class="language-dart"><code>   `startIndex` must not be negative or greater than `length`.
</code></pre>
<p>In this case, an error will be thrown if <code>startIndex</code> is negative
or too large.</p>
<p>If the conditions are not detectable before calling a function,
the called function should not throw an <code>Error</code>.
It may still throw a value,
but the caller will have to catch the thrown value,
effectively making it an alternative result rather 