I am using this to split strings:
let split = Str.split (Str.regexp_string \" \") in let tokens = split instr in ....
But the problem
This is how I split my lines into words:
open Core.Std let tokenize line = String.split line ~on: ' ' |> List.dedup
Mind the single quotes around the space character.
Here's the documentation for String.split: link
String.split