package containers
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1e7992cb2e59c0d2290d1b6c3a31531b3f310be6170b8ef3dde17ccd876b5b79
sha512=bb124e69ad0690f88393e18eee499be07761e767593558867aab32f643466b43258ced503170b154ca3b56dbd68987abd6d9438cf473707ec9866511589a5b84
doc/containers/CCStringLabels/Split/index.html
Module CCStringLabels.Split
Source
Specification of what to do with empty blocks, as in split ~by:"-" "-a-b-"
.
{first=false; last=false}
will return""; "a"; "b"; ""
{first=true; last=false}
will return"a"; "b" ""
{first=false; last=true}
will return""; "a"; "b"
{first=true; last=true}
will return"a"; "b"
The default value of all remaining functions is Drop_none
.
no_drop
does not drop any group, even empty and on borders.
list_ ?drop ~by s
splits the given string s
along the given separator by
. Should only be used with very small separators.
gen ?drop ~by s
splits the given string s
along the given separator by
. Returns a gen
of slices.
iter ?drop ~by s
splits the given string s
along the given separator by
. Returns an iter
of slices.
seq ?drop ~by s
splits the given string s
along the given separator by
. Returns a Seq.t
of slices. Renamed from std_seq
since 3.0.
Copying functions
Those split functions actually copy the substrings, which can be more convenient but less efficient in general.
list_cpy ?drop ~by s
splits the given string s
along the given separator by
. Returns a list
of strings.
gen_cpy ?drop ~by s
splits the given string s
along the given separator by
. Returns a gen
of strings.
iter_cpy ?drop ~by s
splits the given string s
along the given separator by
. Returns an iter
of strings.
seq_cpy ?drop ~by s
splits the given string s
along the given separator by
. Returns a Seq.t
of strings. Renamed from std_seq_cpy
since 3.0.
left ~by s
splits on the first occurrence of by
from the leftmost part of the string s
.
left_exn ~by s
splits on the first occurrence of by
from the leftmost part of the string s
.
right ~by s
splits on the first occurrence of by
from the rightmost part of the string s
.
right_exn ~by s
splits on the first occurrence of by
from the rightmost part of the string s
.