Advertisement
Guest User

csv

a guest
May 14th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.39 KB | None | 0 0
  1. let parse_prefs sep str  =
  2.   let string_index_from i =
  3.     try Some (String.index_from str i sep)
  4.     with Not_found -> None in
  5.     let rec aux i n x =
  6.     match string_index_from i with
  7.     |Some m->let m=StringMap.add (String.sub str i (m-i)) n x in aux (succ m) (succ n) m
  8.     |None -> let m = StringMap.add (String.sub str i (String.length str-i)) n x
  9.     in aux 0 1 StringMap.empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement