Module String.Caseless

Caseless compares and hashes strings ignoring case, so that for example Caseless.equal "OCaml" "ocaml" and Caseless.("apple" < "Banana") are true.

Caseless also provides case-insensitive is_suffix and is_prefix functions, so that for example Caseless.is_suffix "OCaml" ~suffix:"AmL" and Caseless.is_prefix "OCaml" ~prefix:"oc" are true.

type nonrec t = t
include Ppx_hash_lib.Hashable.S_any with type t := t
val hash_fold_t : t Ppx_hash_lib.hash_fold
include Sexplib0.Sexpable.S__stack with type t := t
include Sexplib0.Sexpable.Of_sexp with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
include Sexplib0.Sexpable.Sexp_of__stack with type t := t
val sexp_of_t : t -> Sexplib0.Sexp.t
val t_sexp_grammar : t Sexplib0.Sexp_grammar.t @@ portable
include Comparable.S__portable with type t := t
include Comparisons.S with type t := t
include Comparisons.Infix with type t := t
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int

compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.

val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int @@ portable

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int @@ portable
val between : t -> low:t -> high:t -> bool @@ portable

between t ~low ~high means low <= t <= high

val clamp_exn : t -> min:t -> max:t -> t @@ portable

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Or_error.t @@ portable
include Comparator.S__portable with type t := t
type comparator_witness
include Ppx_compare_lib.Comparable.S__local with type t := t
val is_suffix : t @ local -> (suffix:t @ local -> bool) @ local
val is_prefix : t @ local -> (prefix:t @ local -> bool) @ local
val is_substring : t @ local -> (substring:t @ local -> bool) @ local
val is_substring_at : t @ local -> (pos:int -> (substring:t @ local -> bool) @ local) @ local
val substr_index : ?pos:int -> t @ local -> (pattern:t @ local -> int option) @ local
val substr_index_exn : ?pos:int -> t @ local -> (pattern:t -> int) @ local
val substr_index_all : t @ local -> (may_overlap:bool -> (pattern:t @ local -> int list) @ local) @ local
val substr_replace_first : ?pos:int -> t -> pattern:t @ local -> (with_:t @ local -> t) @ local
val substr_replace_all : t -> pattern:t @ local -> (with_:t @ local -> t) @ local