let split ?(sep = [' ';'\t';'\r';'\n']) s =
let len = String.length s in
let rec loop last cur acc =
if cur > len then acc else
let next = cur+1 in
if cur = len || List.mem s.[cur] sep then
if cur > last then loop next next (String.sub s ~pos:last ~len:(cur-last) :: acc)
else loop next next acc
else loop last next acc
in List.rev (loop 0 0 [])