package opam-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Collections

module Map : MAP with type key = string
module Set : SET with type elt = string
module SetSet : SET with type elt = Set.t

Set of string sets

module SetMap : MAP with type key = Set.t

Map of string sets

Checks

val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains : string -> char -> bool
val exact_match : Re.re -> string -> bool

Manipulation

val map : (char -> char) -> string -> string
val strip : string -> string
val sub_at : int -> string -> string
val remove_prefix : prefix:string -> string -> string
val remove_suffix : suffix:string -> string -> string
Transformations
val cut_at : string -> char -> (string * string) option

Cut a string at the first occurence of the given char

val rcut_at : string -> char -> (string * string) option

Same as cut_at, but starts from the right

val split : string -> char -> string list

Split a string at occurences of a given characters. Empty strings are skipped.

val split_delim : string -> char -> string list

The same as split, but keep empty strings (leading, trailing or between contiguous delimiters)

val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
OCaml

Innovation. Community. Security.