TzPervasives.String
include module type of Stdlib.String
val to_seq : t -> char Stdlib.Seq.t
val to_seqi : t -> (int * char) Stdlib.Seq.t
val of_seq : char Stdlib.Seq.t -> t
val get_utf_8_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_8 : t -> bool
val get_utf_16be_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16be : t -> bool
val get_utf_16le_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16le : t -> bool
include module type of Mavryk_stdlib.TzString
split delim ~limit str
splits str
into a list of strings. Splitting occurs on delim
characters (which are removed from output) at most limit
times. Remaining delim
characters are included in the last element of the resulting list.
limit
defaults to max_int
.
This function obeys the invariant that for all limit
s, delim
s and str
s: String.concat (String.init 1 (fun _ -> delim)) (split delim ~limit str) = str
.
Splits a string on a delimiter character. It strips delimiters at the beginning and at the end. It considers groups of delimiters as one. If limit
is passed, stops after limit
split(s). limit
defaults to max_int
. It's guaranteed to never produce empty strings in the output. Therefore, it's capable of producing an empty list as a result.
For example, split_no_empty ',' ",hello,,world,"
returns "hello"; "world"
chunk_bytes n b
chunks the sequence of bytes b
into a list of strings, each of length n
. The last chunk may be a non-empty string of length less than n
, in which case the behaviour of the function depends on whether error_on_partial_chunk
is set:
error_on_partial_chunk
is set, then the function returns Error error_on_partial_chunk
,n
.Some (input with prefix
removed), if string has prefix
, else None
Some (input with suffix
removed), if string has suffix
, else None
Functional iteration over the characters of a string from first to last
module Hashtbl :
Mavryk_error_monad.TzLwtreslib.Hashtbl.SeededS with type key = t
module Map : Mavryk_error_monad.TzLwtreslib.Map.S with type key = t
module Set : Mavryk_error_monad.TzLwtreslib.Set.S with type elt = t