Created
November 30, 2018 08:16
-
-
Save piq9117/252c7e240dd910614ad924c943c87dba to your computer and use it in GitHub Desktop.
This file contains hidden or 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 explode s = | |
let rec expl i l = | |
if i < 0 then l else | |
expl (i - 1) (s.[i] :: l) in | |
expl (String.length s - 1) [] | |
let implode l = | |
let result = Bytes.create (List.length l) in | |
let rec imp i = function | |
| [] -> result | |
| c :: l -> result.[i] <- c; imp (i + 1) l in | |
imp 0 l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment