package fmlib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=d47f6539af49a4c3e947dbfbe416c1e78d534897cd6d9d8e3660aae0cf8d9494
md5=d649b8a62403362bd3a24cbf1a9af590
doc/fmlib.fmlib_std/Fmlib_std/String/index.html
Module Fmlib_std.String
A small wrapper around Stdlib.String with some extra functions.
Use Stdlib.String if you need functions from the ocaml standard library which are not in this module.
compare s1 s2 Compare the strings s1 and s2.
Return -1, if s1 is lexicographically smaller than s2 Return 0, if both string are equal Return +1, if s1 is lexicographically greater than s2
val one : char -> tone c A string with the character c as the only character.
val find : (char -> bool) -> int -> t -> intfind p start str Find the position of the first character starting from start in the string str which satisfies the predicate p. If no character can be found return the length of the string.
val has : (char -> bool) -> int -> t -> boolhas p start str Does the string str starting from position start have a character satisfying the predicate p?
val find_bwd : (char -> bool) -> int -> t -> intfind_bwd p beyond str Find the position of the first character before beyond in the string str which satisfies the predicate p. Return -1, if no character can be found.
val list : t -> char listlist str Convert the string str to a list of characters.
val of_list : char list -> tof_list l Convert the list l of characters to a string.
val length : t -> intlength str The length of the string str.
val get : t -> int -> charget str i The ith character of the string str.
Precondition: 0 <= i && i < length str
sub str start len The substring of str starting at start with length len.
Precondition: 0 <= start <= start + len <= length str
concat sep str_list Concatenate the strings in the string list str_list and put the separator sep between them.
split_on_char c str Split the string str on each occurrence of the character c into a list of strings.
val make : int -> char -> tmake n c Make a string with n copies of the character c.
val init : int -> (int -> char) -> tinit n f Make a string of length n where the ith character is f i.
module To_source : sig ... endConversion of a string to a source of characters.
module From_source (S : Interfaces.SOURCE with type item = char) : sig ... endConversion of a source of characters to a string.