package tezos-stdlib

  1. Overview
  2. Docs
module Set : Stdlib.Set.S with type elt = string
module Map : Stdlib.Map.S with type key = string
val split_path : string -> string list

Splits a string on slashes, grouping multiple slashes, and ignoring slashes at the beginning and end of string.

val split : char -> ?dup:bool -> ?limit:int -> string -> string list

Splits a string on a delimiter character. If dup is set to true, groups multiple delimiters and strips delimiters at the beginning and end of string. If limit is passed, stops after limit split(s). dups defaults to true and limit defaults to max_int. Examples:

  • split ~dup:true ',' ",hello,,world,"] returns "hello"; "world"
  • split ~dup:false ',' ",,hello,,,world,,"] returns ""; "hello"; ""; ""; "world"; ""
val has_prefix : prefix:string -> string -> bool

true if input has prefix

val remove_prefix : prefix:string -> string -> string option

Some (input with prefix removed), if string has prefix, else None

val common_prefix : string -> string -> int

Length of common prefix of input strings

val mem_char : string -> char -> bool

Test whether a string contains a given character

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

Functional iteration over the characters of a string from first to last

val is_hex : string -> bool

Test whether a string is a valid hexadecimal value

OCaml

Innovation. Community. Security.