From 561d0f0155f4906d90eb7e73a3ff9cb28909126f Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 5 Feb 2021 09:08:39 +0100 Subject: Update project structure --- shapes/matrix/Helpers.ml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 shapes/matrix/Helpers.ml (limited to 'shapes/matrix/Helpers.ml') diff --git a/shapes/matrix/Helpers.ml b/shapes/matrix/Helpers.ml deleted file mode 100755 index 6980052..0000000 --- a/shapes/matrix/Helpers.ml +++ /dev/null @@ -1,16 +0,0 @@ -(* Takes in a string and a separator, and separates the string into a list of - * substrings where each substring is between two separators or between a - * separator and the beginning/end of the string *) -let explode (s: string) (space: string) : string list = - let rec build (curr: string) (buffer: string) (lst: string list) : string list = - let len = String.length curr in - if len = 0 then buffer::lst - else - let c = String.sub curr (len - 1) 1 in - if len = 1 then (c ^ buffer)::lst - else - let s' = String.sub curr 0 (len - 1) in - if c = space then build s' "" (buffer::lst) - else build s' (c ^ buffer) lst in - build (String.trim s) "" [] - -- cgit v1.2.3