package spotlib
Module Spotlib.XbytesSource
Construction
make1 = Bytes.make 1
Sysnonym make1
Deconstruction
Array
val scani_left :
(int -> 'a -> char -> [< `Continue of 'a | `Stop of 'a ]) ->
'a ->
?from:int ->
?to_:int ->
bytes ->
'aval foldi_left :
(int -> 'a -> char -> [< `Continue of 'a | `Stop of 'a ]) ->
'a ->
bytes ->
'areplace_chars c1 c2 s returns a copy of s with replacing all the char occurrences of c1 by c2.
Transform
chop_eols s returns the bytes s w/o the end-of-line chars. chop from Perl. chop_eols "hello\r\n" = "hello" chop_eols "hello\n" = "hello" chop_eols "hello\r" = "hello" chop_eols "hello" = "hello"
Sub
Same as Bytes.sub but even if the bytes shorter for len the function succeeds and returns a shorter subbytes.
Same as prefix but returns the postfix
Same as postfix but returns the prefix
Haskelish bytes sub
same as take
Split
lines "hello\nworld\r\ngood\rday" = ["hello", "\n"; "world", "\r\n"; "good", "\r"; "day", ""]
split (function ' ' -> true | _ -> false) "hello world" = ["hello"; "world"]
Same as split but do the split only once
Split a bytes into "words" by white characters ' ', '\t', '\r' and '\n'
Optionalized
Random
human readable
Misc
Stdlib
Set