Module CCUtf8_string
Unicode String, in UTF8
type uchar= Uchar.ttype 'a gen= unit -> 'a optiontype 'a sequence= ('a -> unit) -> unittype t= private stringA UTF8 string
val equal : t -> t -> boolval hash : t -> intval compare : t -> t -> intval pp : Format.formatter -> t -> unitval to_string : t -> stringIdentity.
val to_gen : ?idx:int -> t -> uchar genGenerator of unicode codepoints.
- parameter idx
offset where to start the decoding.
val to_seq : ?idx:int -> t -> uchar sequenceSequence of unicode codepoints.
- parameter idx
offset where to start the decoding.
val to_list : ?idx:int -> t -> uchar listList of unicode codepoints.
- parameter idx
offset where to start the decoding.
val fold : ?idx:int -> ('a -> uchar -> 'a) -> 'a -> t -> 'aval iter : ?idx:int -> (uchar -> unit) -> t -> unitval n_chars : t -> intNumber of characters.
val n_bytes : t -> intNumber of bytes.
val map : (uchar -> uchar) -> t -> tval filter_map : (uchar -> uchar option) -> t -> tval flat_map : (uchar -> t) -> t -> tval append : t -> t -> tval concat : t -> t list -> tval of_seq : uchar sequence -> tval of_gen : uchar gen -> tval of_list : uchar list -> tval of_string_exn : string -> tValidate string by checking it is valid UTF8.
- raises Invalid_argument
if the string is not valid UTF8.
val of_string : string -> t optionSafe version of
of_string_exn.
val unsafe_of_string : string -> tConversion from a string without validating. Upon iteration, if an invalid substring is met, Malformed will be raised.