projects
/
SXSI
/
xpathcomp.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
put the mergeJoin function into its own class
[SXSI/xpathcomp.git]
/
src
/
utils.ml
1
module String =
2
struct
3
include String
4
5
let explode s sep =
6
let len = length s in
7
let buff = Buffer.create 40 in
8
let rec loop i =
9
if i >= len then
10
[ Buffer.contents buff ]
11
else
12
let c = s.[i] in
13
if c == sep then
14
let ss = Buffer.contents buff in
15
Buffer.clear buff;
16
ss :: loop (i+1)
17
else begin
18
Buffer.add_char buff c;
19
loop (i+1);
20
end
21
in
22
loop 0
23
end
24
;;