On Tue, Jul 10, 2012 at 2:28 AM, Andrew Deane
<
andrew....@googlemail.com> wrote:
>
> I would expect that if the value isn't found in the array I would be
> returned the length of the array (or -1) to indicate I fell off the end.
> What I do get returned is the index of the first failing value because of
> the way that SearchStrings calls Search. I'm all for this fail fast short
> circuit of the search.
In effect, the function returns the point where the new string would
be inserted, if you plan to insert it. You need an additional
comparison to see if the string you want is in the array.
> I can check the string at the returned index in the array is equal to the
> value I am looking for to find my answer, but I was just wondering if this
> was what is expected.
Yes, this is expected.
Ian