Module CCUtf8_string
Unicode String, in UTF8
type uchar= Stdlib.Uchar.ttype 'a gen= unit -> 'a optiontype 'a iter= ('a -> unit) -> unitFast internal iterator.
- since
- 2.8
val equal : t -> t -> boolval hash : t -> intval compare : t -> t -> intval pp : Stdlib.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_iter : ?idx:int -> t -> uchar iterIterator of unicode codepoints.
- parameter idx
offset where to start the decoding.
- since
- 2.8
val to_seq : ?idx:int -> t -> uchar Stdlib.Seq.tIter of unicode codepoints. Renamed from
to_std_seqsince 3.0.- parameter idx
offset where to start the decoding.
- since
- 3.0
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 Stdlib.Seq.t -> tBuild a string from unicode codepoints Renamed from
of_std_seqsince 3.0.- since
- 3.0
val 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. CAUTION this is unsafe and can break all the other functions in this module. Use only if you're sure the string is valid UTF8. Upon iteration, if an invalid substring is met, Malformed will be raised.