0

ReasonML is built upon OCaml, and much of OCaml stdlib is available on ReasonML. However, ExtString is not one of them.

I'm in need of using ExtString.exists to verify if a substring sub exists within a string str. I know that I can make my own function, as explained here, but I'm wondering if there's any way I can import ExtString from or OCaml, or if there's a equivalend module on stdlib that I didn't realize.

Mateus Felipe
  • 1,071
  • 2
  • 19
  • 43

1 Answers1

2

When compiling to JavaScript you have Js.String.includes as replacement for Str.exists specifically, and more generally I think the Js.String module should cover most of ExtString.

When compiling to native you can just use ExtString. Reason is just an alternative syntax for OCaml, everything else works exactly the same.

glennsl
  • 28,186
  • 12
  • 57
  • 75