Does OCaml have String.split function like Python?

后端 未结 4 610
离开以前
离开以前 2021-01-12 01:24

I am using this to split strings:

 let split = Str.split (Str.regexp_string \" \") in
   let tokens = split instr in
 ....

But the problem

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-12 01:59

    Don't use Str.regexp_string, it's only for matching fixed strings.

    Use Str.split (Str.regexp " +")

提交回复
热议问题