Batteries user guide : Extlib.ExtString

`sig
module String :
sig
val init : int -> (int -> char) -> string
val is_empty : string -> bool
external length : string -> int = "%string_length"
external get : string -> int -> char = "%string_safe_get"
external set : string -> int -> char -> unit = "%string_safe_set"
external create : int -> string = "caml_create_string"
val make : int -> char -> string
val copy : string -> string
val sub : string -> int -> int -> string
val fill : string -> int -> int -> char -> unit
val blit : string -> int -> string -> int -> int -> unit
val concat : string -> string list -> string
val iter : (char -> unit) -> string -> unit
val escaped : string -> string
val index : string -> char -> int
val rindex : string -> char -> int
val index_from : string -> int -> char -> int
val rindex_from : string -> int -> char -> int
val contains : string -> char -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val uppercase : string -> string
val lowercase : string -> string
val capitalize : string -> string
val uncapitalize : string -> string
type t = string
val enum : string -> char BatEnum.t
val of_enum : char BatEnum.t -> string
val backwards : string -> char BatEnum.t
val of_backwards : char BatEnum.t -> string
val of_list : char list -> string
val to_list : string -> char list
val of_int : int -> string
val of_float : float -> string
val of_char : char -> string
val to_int : string -> int
val to_float : string -> float
val map : (char -> char) -> string -> string
val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
val fold_right : (char -> 'a -> 'a) -> string -> 'a -> 'a
val filter : (char -> bool) -> string -> string
val filter_map : (char -> char option) -> string -> string
val iteri : (int -> char -> unit) -> string -> unit
val find : string -> string -> int
val find_from : string -> int -> string -> int
val rfind : string -> string -> int
val rfind_from : string -> int -> string -> int
val ends_with : string -> string -> bool
val starts_with : string -> string -> bool
val exists : string -> string -> bool
val lchop : ?n:int -> string -> string
val rchop : ?n:int -> string -> string
val trim : string -> string
val quote : string -> string
val left : string -> int -> string
val right : string -> int -> string
val head : string -> int -> string
val tail : string -> int -> string
val strip : ?chars:string -> string -> string
val replace_chars : (char -> string) -> string -> string
val replace : str:string -> sub:string -> by:string -> bool * string
val nreplace : str:string -> sub:string -> by:string -> string
val repeat : string -> int -> string
val rev : string -> string
val rev_in_place : string -> unit
val in_place_mirror : string -> unit
val split : string -> by:string -> string * string
val rsplit : string -> by:string -> string * string
val nsplit : string -> by:string -> string list
val join : string -> string list -> string
val slice : ?first:int -> ?last:int -> string -> string
val splice : string -> int -> int -> string -> string
val explode : string -> char list
val implode : char list -> string
val equal : t -> t -> bool
val ord : t -> t -> BatOrd.order
val compare : t -> t -> int
val icompare : t -> t -> int
module IString : sig type t = t val compare : t -> t -> int end
val numeric_compare : t -> t -> int
module NumString : sig type t = t val compare : t -> t -> int end
val print : 'a BatInnerIO.output -> string -> unit
val println : 'a BatInnerIO.output -> string -> unit
val print_quoted : 'a BatInnerIO.output -> string -> unit
module Exceptionless :
sig
val to_int : string -> int option
val to_float : string -> float option
val index : string -> char -> int option
val rindex : string -> char -> int option
val index_from : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int option
val find : string -> string -> int option
val find_from : string -> int -> string -> int option
val rfind : string -> string -> int option
val rfind_from : string -> int -> string -> int option
val split : string -> by:string -> (string * string) option
val rsplit : string -> by:string -> (string * string) option
end
module Cap :
sig
type 'a t = 'a BatString.Cap.t
external length : 'a t -> int = "%string_length"
val is_empty : 'a t -> bool
external get : [> `Read ] t -> int -> char = "%string_safe_get"
external set : [> `Write ] t -> int -> char -> unit
= "%string_safe_set"
external create : int -> 'a t = "caml_create_string"
external of_string : string -> 'a t = "%identity"
external to_string : [ `Read | `Write ] t -> string = "%identity"
external read_only : [> `Read ] t -> [ `Read ] t = "%identity"
external write_only : [> `Write ] t -> [ `Write ] t = "%identity"
val make : int -> char -> 'a t
val init : int -> (int -> char) -> 'a t
val enum : [> `Read ] t -> char BatEnum.t
val of_enum : char BatEnum.t -> 'a t
val backwards : [> `Read ] t -> char BatEnum.t
val of_backwards : char BatEnum.t -> 'a t
val of_list : char list -> 'a t
val to_list : [> `Read ] t -> char list
val of_int : int -> 'a t
val of_float : float -> 'a t
val of_char : char -> 'a t
val to_int : [> `Read ] t -> int
val to_float : [> `Read ] t -> float
val map : (char -> char) -> [> `Read ] t -> 'a t
val fold_left : ('a -> char -> 'a) -> 'a -> [> `Read ] t -> 'a
val fold_right : (char -> 'a -> 'a) -> [> `Read ] t -> 'a -> 'a
val filter : (char -> bool) -> [> `Read ] t -> 'a t
val filter_map : (char -> char option) -> [> `Read ] t -> 'a t
val iter : (char -> unit) -> [> `Read ] t -> unit
val index : [> `Read ] t -> char -> int
val rindex : [> `Read ] t -> char -> int
val index_from : [> `Read ] t -> int -> char -> int
val rindex_from : [> `Read ] t -> int -> char -> int
val contains : [> `Read ] t -> char -> bool
val contains_from : [> `Read ] t -> int -> char -> bool
val rcontains_from : [> `Read ] t -> int -> char -> bool
val find : [> `Read ] t -> [> `Read ] t -> int
val find_from : [> `Read ] t -> int -> [> `Read ] t -> int
val rfind : [> `Read ] t -> [> `Read ] t -> int
val rfind_from : [> `Read ] t -> int -> [> `Read ] t -> int
val ends_with : [> `Read ] t -> [> `Read ] t -> bool
val starts_with : [> `Read ] t -> [> `Read ] t -> bool
val exists : [> `Read ] t -> [> `Read ] t -> bool
val lchop : ?n:int -> [> `Read ] t -> 'a t
val rchop : ?n:int -> [> `Read ] t -> 'a t
val trim : [> `Read ] t -> 'a t
val quote : [> `Read ] t -> string
val left : [> `Read ] t -> int -> 'a t
val right : [> `Read ] t -> int -> 'a t
val head : [> `Read ] t -> int -> 'a t
val tail : [> `Read ] t -> int -> 'a t
val strip : ?chars:[> `Read ] t -> [> `Read ] t -> 'a t
val uppercase : [> `Read ] t -> 'a t
val lowercase : [> `Read ] t -> 'a t
val capitalize : [> `Read ] t -> 'a t
val uncapitalize : [> `Read ] t -> 'a t
val copy : [> `Read ] t -> 'a t
val sub : [> `Read ] t -> int -> int -> 'a t
val fill : [> `Write ] t -> int -> int -> char -> unit
val blit :
[> `Read ] t -> int -> [> `Write ] t -> int -> int -> unit
val concat : [> `Read ] t -> [> `Read ] t list -> 'a t
val escaped : [> `Read ] t -> 'a t
val replace_chars : (char -> [> `Read ] t) -> [> `Read ] t -> 'a t
val replace :
str:[> `Read ] t ->
sub:[> `Read ] t -> by:[> `Read ] t -> bool * 'a t
val nreplace :
str:[> `Read ] t -> sub:[> `Read ] t -> by:[> `Read ] t -> 'a t
val repeat : [> `Read ] t -> int -> 'a t
val split : [> `Read ] t -> by:[> `Read ] t -> 'a t * 'b t
val rsplit : [> `Read ] t -> by:string -> string * string
val nsplit : [> `Read ] t -> by:[> `Read ] t -> 'a t list
val splice :
[ `Read | `Write ] t -> int -> int -> [> `Read ] t -> string
val join : [> `Read ] t -> [> `Read ] t list -> 'a t
val slice : ?first:int -> ?last:int -> [> `Read ] t -> 'a t
val explode : [> `Read ] t -> char list
val implode : char list -> 'a t
val compare : [> `Read ] t -> [> `Read ] t -> int
val icompare : [> `Read ] t -> [> `Read ] t -> int
val print : 'a BatInnerIO.output -> [> `Read ] t -> unit
val println : 'a BatInnerIO.output -> [> `Read ] t -> unit
val print_quoted : 'a BatInnerIO.output -> [> `Read ] t -> unit
external unsafe_get : [> `Read ] t -> int -> char
= "%string_unsafe_get"
external unsafe_set : [> `Write ] t -> int -> char -> unit
= "%string_unsafe_set"
external unsafe_blit :
[> `Read ] t -> int -> [> `Write ] t -> int -> int -> unit
= "caml_blit_string" "noalloc"
external unsafe_fill : [> `Write ] t -> int -> int -> char -> unit
= "caml_fill_string" "noalloc"
module Exceptionless :
sig
val to_int : [> `Read ] t -> int option
val to_float : [> `Read ] t -> float option
val index : [> `Read ] t -> char -> int option
val rindex : [> `Read ] t -> char -> int option
val index_from : [> `Read ] t -> int -> char -> int option
val rindex_from : [> `Read ] t -> int -> char -> int option
val find : [> `Read ] t -> [> `Read ] t -> int option
val find_from :
[> `Read ] t -> int -> [> `Read ] t -> int option
val rfind : [> `Read ] t -> [> `Read ] t -> int option
val rfind_from :
[> `Read ] t -> int -> [> `Read ] t -> int option
val split :
[> `Read ] t -> by:[> `Read ] t -> ('a t * 'b t) option
val rsplit :
[> `Read ] t -> by:[> `Read ] t -> ('a t * 'b t) option
end
end
external unsafe_get : string -> int -> char = "%string_unsafe_get"
external unsafe_set : string -> int -> char -> unit
= "%string_unsafe_set"
external unsafe_blit : string -> int -> string -> int -> int -> unit
= "caml_blit_string" "noalloc"
external unsafe_fill : string -> int -> int -> char -> unit
= "caml_fill_string" "noalloc"
end
end`