package opam-core

  1. Overview
  2. Docs

Module OpamStd.StringSource

Collections

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

Set of string sets

Sourcemodule SetMap : MAP with type key = Set.t

Map of string sets

Checks

Sourceval starts_with : prefix:string -> string -> bool
Sourceval ends_with : suffix:string -> string -> bool
Sourceval contains_char : string -> char -> bool
Sourceval contains : sub:string -> string -> bool
Sourceval exact_match : Re.re -> string -> bool

Manipulation

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

Cut a string at the first occurrence of the given char

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

Same as cut_at, but starts from the right

Sourceval split : string -> char -> string list

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

Sourceval split_delim : string -> char -> string list

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

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

Innovation. Community. Security.