I am trying this simple code to split a string to a list by a separator:
open String;;
let ss = "/usr/bin/ocaml";;
let sslist = String.split_on_char '/' ss in
print_endline sslist;;
It is giving error:
$ ocaml testing.ml
File "testing.ml", line 5, characters 13-33:
Error: Unbound value String.split_on_char
I am sure it is something very basic but I am not able to solve it. Removing open String
or using #require "string"
also does not work.
Where is the problem and how can it be solved? Thanks for your help.