Last active
August 29, 2015 14:21
-
-
Save l1x/f679b38a4486a6bfe8db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let one_dot_words (~string:str string) (~character:chr char) = | |
let rec one_dot_words_aux (str : string) (chr : char) (pos : int) (acc : string list) : string list = | |
let max = Bytes.length str in | |
let tmp = Bytes.copy str in | |
if pos = max then | |
acc | |
else | |
one_dot_words_aux str chr (pos + 1) ((Bytes.set tmp pos chr;tmp) :: acc ) in | |
one_dot_words_aux str chr 0 [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment