module UTF8Impl:sig..end
One is advised to use the Utils.UTF8 module instead of this one.
type t
type modified
typebytes =string
string,
used to underline its use as an array of bytes.type error =
| |
Unable_to_convert_to_modified_utf8 of |
| |
Unable_to_convert_from_modified_utf8 of |
| |
Unable_to_convert_to_utf8 of |
| |
Unable_to_convert_from_utf8 of |
| |
Invalid_index of |
| |
Index_out_of_bounds of |
| |
Invalid_escaped_string of |
exception Exception of error
val string_of_error : error -> stringval make : UCharImpl.t list -> tval modified_of_bytes : bytes -> modifiedval bytes_of_modified : modified -> bytesval to_modified : t -> modifiedException if conversion fails.val of_modified : modified -> tException if conversion fails.val to_string : t -> stringException if conversion fails.val to_string_noerr : t -> stringto_string, except that any exception is discarded and
"..." is returned.val of_string : string -> tException if conversion fails.val to_bytes : t -> bytesException if conversion fails.val of_bytes : bytes -> tException if conversion fails.val of_char : char -> tException if conversion fails.val of_uchar : UCharImpl.t -> tval length : t -> intval get : t -> int -> UCharImpl.tget s i returns the character of s at index i.
Raises Exception if index is not valid.val equal : t -> t -> boolval compare : t -> t -> intval hash : t -> intval index_from : t -> int -> UCharImpl.t -> intindex_from s i c returns the lowest index above or equal to i
where string s contains a character that equals c.
Raises Not_found if such an index does not exist.val rindex_from : t -> int -> UCharImpl.t -> intrindex_from s i c returns the highest index below or equal to i
where string s contains a character that equals c.
Raises Not_found if such an index does not exist.val substring : t -> int -> int -> tsubstring s start end returns a string whose characters are those
of s from index first to index last (both inclusive).
Returns an empty string iff last < first.
Raises Exception if first or last is not a valid index.val (++) : t -> t -> tval concat : t list -> tconcat l returns the concatenation of all strings in l.val concat_sep : t -> t list -> tconcat_sep sep l returns the concatenation of all strings in l,
separator sep being inserted between two strings.val concat_sep_map : t -> ('a -> t) -> 'a list -> tconcat_sep_map sep f l returns the concatenation of all strings in
l', separator sep being inserted between two strings.
l' is defined as List.map f l.val replace : UCharImpl.t -> UCharImpl.t -> t -> treplace c1 c2 s returns a copy of s where every character equal
to c1 has been replaced by c2.val contains : UCharImpl.t -> t -> boolcontains c s returns true iff string s contains a character
equal to c.val split : UCharImpl.t -> t -> t listsplit c s returns the string list obtained by splitting s using
delimiter c.val trim : t -> ttrim s returns the passed string with neither leading nor trailing
spaces.val escape : t -> tescape s returns the literal constant string corresponding to the
passed string. A leading and a trailing double quote are added and
every quote inside the passed string is escaped by a backslash.val unescape : t -> tunescape s returns the string corresponding to the passed literal
constant string. Both leading and trailing quotes are removed and
escaped sequences are converted.val escape_char : UCharImpl.t -> tescape_char c returns the literal constant string corresponding to
the passed character. A leading and a trailing simple quote are added.