Hello, I would like to use OCaml code like “try ignore (Str.search_forward (Str.regexp " when done") xb 6); …”. Now I am looking for the explanation of the message “Fatal error: exception Invalid_argument("Str.search_forward")”. Regards, Markus
Hi Markus,
Are you sure that String.length xb >= 6 ?
Cheers,
Nicolás
On Thu, Jun 6, 2019 at 10:33 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> Hello,
>
> I would like to use OCaml code like “try ignore (Str.search_forward (Str.regexp " when done") xb 6); …”.
> Now I am looking for the explanation of the message “Fatal error:
> exception Invalid_argument("Str.search_forward")”.
>
> Regards,
> Markus
> Are you sure that String.length xb >= 6 ?
* Do you expect the information “Raises Invalid_argument if the string length
is shorter than the passed start position”?
* Would an extension become helpful for the documentation of this function call?
Regards,
Markus
Markus Elfring wrote: > > Are you sure that String.length xb >= 6 ? > > * Do you expect the information “Raises Invalid_argument if the string > length is shorter than the passed start position”? Yes, cf. https://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html#VALindex_from > * Would an extension become helpful for the documentation of this > function call? Yes - would you be able to make a pull request? David