diff --git a/dev/containers/CCString/index.html b/dev/containers/CCString/index.html index 93a424fe..26a2ef2f 100644 --- a/dev/containers/CCString/index.html +++ b/dev/containers/CCString/index.html @@ -4,4 +4,4 @@ sub:string -> by:string -> string -> - string

replace ~which ~sub ~by s replaces some occurrences of sub by by in s.

val is_sub : sub:string -> int -> string -> int -> sub_len:int -> bool

is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.

val repeat : string -> int -> string

repeat s n creates a string by repeating the string s n times.

val prefix : pre:string -> string -> bool

prefix ~pre s returns true iff pre is a prefix of s.

val suffix : suf:string -> string -> bool

suffix ~suf s returns true iff suf is a suffix of s.

val chop_prefix : pre:string -> string -> string option

chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.

val chop_suffix : suf:string -> string -> string option

chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.

val take : int -> string -> string

take n s keeps only the n first chars of s.

val drop : int -> string -> string

drop n s removes the n first chars of s.

val take_drop : int -> string -> string * string

take_drop n s is take n s, drop n s.

val lines : string -> string list

lines s returns a list of the lines of s (splits along '\n').

val lines_gen : string -> string gen

lines_gen s returns the gen of the lines of s (splits along '\n').

val lines_iter : string -> string iter

lines_iter s returns the iter of the lines of s (splits along '\n').

val lines_seq : string -> string Stdlib.Seq.t

lines_seq s returns the Seq.t of the lines of s (splits along '\n').

val concat_gen : sep:string -> string gen -> string

concat_gen ~sep gen concatenates all strings of gen, separated with sep.

val concat_seq : sep:string -> string Stdlib.Seq.t -> string

concat_seq ~sep seq concatenates all strings of seq, separated with sep.

val concat_iter : sep:string -> string iter -> string

concat_iter ~sep iter concatenates all strings of iter, separated with sep.

val unlines : string list -> string

unlines ls concatenates all strings of ls, separated with '\n'.

val unlines_gen : string gen -> string

unlines_gen gen concatenates all strings of gen, separated with '\n'.

val unlines_iter : string iter -> string

unlines_iter iter concatenates all strings of iter, separated with '\n'.

val unlines_seq : string Stdlib.Seq.t -> string

unlines_seq seq concatenates all strings of seq, separated with '\n'.

val set : string -> int -> char -> string

set s i c creates a new string which is a copy of s, except for index i, which becomes c.

val iter : ( char -> unit ) -> string -> unit

iter f s applies function f on each character of s. Alias to String.iter.

val filter_map : ( char -> char option ) -> string -> string

filter_map f s calls (f a0) (f a1) … (f an) where a0 … an are the characters of s. It returns the string of characters ci such as f ai = Some ci (when f returns None, the corresponding element of s is discarded).

val filter : ( char -> bool ) -> string -> string

filter f s discards characters of s not satisfying f.

val uniq : ( char -> char -> bool ) -> string -> string

uniq eq s remove consecutive duplicate characters in s.

val flat_map : ?sep:string -> ( char -> string ) -> string -> string

flat_map ~sep f s maps each chars of s to a string, then concatenates them all.

val for_all : ( char -> bool ) -> string -> bool

for_all f s is true iff all characters of s satisfy the predicate f.

val exists : ( char -> bool ) -> string -> bool

exists f s is true iff some character of s satisfy the predicate f.

val drop_while : ( char -> bool ) -> t -> t

drop_while f s discards any characters of s starting from the left, up to the first character c not satisfying f c.

val rdrop_while : ( char -> bool ) -> t -> t

rdrop_while f s discards any characters of s starting from the right, up to the first character c not satisfying f c.

val ltrim : t -> t

ltrim s trims space on the left (see String.trim for more details).

val rtrim : t -> t

rtrim s trims space on the right (see String.trim for more details).

Operations on 2 strings

val map2 : ( char -> char -> char ) -> string -> string -> string

map2 f s1 s2 maps pairs of chars.

val iter2 : ( char -> char -> unit ) -> string -> string -> unit

iter2 f s1 s2 iterates on pairs of chars.

val iteri2 : ( int -> char -> char -> unit ) -> string -> string -> unit

iteri2 f s1 s2 iterates on pairs of chars with their index.

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

fold2 f init s1 s2 folds on pairs of chars.

val for_all2 : ( char -> char -> bool ) -> string -> string -> bool

for_all2 f s1 s2 returns true iff all pairs of chars satisfy the predicate f.

val exists2 : ( char -> char -> bool ) -> string -> string -> bool

exists2 f s1 s2 returns true iff a pair of chars satisfy the predicate f.

Ascii functions

Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.

val equal_caseless : string -> string -> bool

equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.

Finding

A relatively efficient algorithm for finding sub-strings.

module Find : sig ... end

Splitting

module Split : sig ... end
val split_on_char : char -> string -> string list

split_on_char by s splits the string s along the given char by.

val split : by:string -> string -> string list

split ~by s splits the string s along the given string by. Alias to Split.list_cpy.

Utils

val compare_versions : string -> string -> int

compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.

val compare_natural : string -> string -> int

compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order

val edit_distance : ?cutoff:int -> string -> string -> int

edit_distance ~cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.

Infix operators

module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file + string

replace ~which ~sub ~by s replaces some occurrences of sub by by in s.

val is_sub : sub:string -> int -> string -> int -> sub_len:int -> bool

is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.

val repeat : string -> int -> string

repeat s n creates a string by repeating the string s n times.

val prefix : pre:string -> string -> bool

prefix ~pre s returns true iff pre is a prefix of s.

val suffix : suf:string -> string -> bool

suffix ~suf s returns true iff suf is a suffix of s.

val chop_prefix : pre:string -> string -> string option

chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.

val chop_suffix : suf:string -> string -> string option

chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.

val take : int -> string -> string

take n s keeps only the n first chars of s.

val drop : int -> string -> string

drop n s removes the n first chars of s.

val take_drop : int -> string -> string * string

take_drop n s is take n s, drop n s.

val lines : string -> string list

lines s returns a list of the lines of s (splits along '\n').

val lines_gen : string -> string gen

lines_gen s returns the gen of the lines of s (splits along '\n').

val lines_iter : string -> string iter

lines_iter s returns the iter of the lines of s (splits along '\n').

val lines_seq : string -> string Stdlib.Seq.t

lines_seq s returns the Seq.t of the lines of s (splits along '\n').

val concat_gen : sep:string -> string gen -> string

concat_gen ~sep gen concatenates all strings of gen, separated with sep.

val concat_seq : sep:string -> string Stdlib.Seq.t -> string

concat_seq ~sep seq concatenates all strings of seq, separated with sep.

val concat_iter : sep:string -> string iter -> string

concat_iter ~sep iter concatenates all strings of iter, separated with sep.

val unlines : string list -> string

unlines ls concatenates all strings of ls, separated with '\n'.

val unlines_gen : string gen -> string

unlines_gen gen concatenates all strings of gen, separated with '\n'.

val unlines_iter : string iter -> string

unlines_iter iter concatenates all strings of iter, separated with '\n'.

val unlines_seq : string Stdlib.Seq.t -> string

unlines_seq seq concatenates all strings of seq, separated with '\n'.

val set : string -> int -> char -> string

set s i c creates a new string which is a copy of s, except for index i, which becomes c.

val iter : ( char -> unit ) -> string -> unit

iter f s applies function f on each character of s. Alias to String.iter.

val filter_map : ( char -> char option ) -> string -> string

filter_map f s calls (f a0) (f a1) … (f an) where a0 … an are the characters of s. It returns the string of characters ci such as f ai = Some ci (when f returns None, the corresponding element of s is discarded).

val filter : ( char -> bool ) -> string -> string

filter f s discards characters of s not satisfying f.

val uniq : ( char -> char -> bool ) -> string -> string

uniq eq s remove consecutive duplicate characters in s.

val flat_map : ?sep:string -> ( char -> string ) -> string -> string

flat_map ~sep f s maps each chars of s to a string, then concatenates them all.

val for_all : ( char -> bool ) -> string -> bool

for_all f s is true iff all characters of s satisfy the predicate f.

val exists : ( char -> bool ) -> string -> bool

exists f s is true iff some character of s satisfy the predicate f.

val drop_while : ( char -> bool ) -> t -> t

drop_while f s discards any characters of s starting from the left, up to the first character c not satisfying f c.

val rdrop_while : ( char -> bool ) -> t -> t

rdrop_while f s discards any characters of s starting from the right, up to the first character c not satisfying f c.

val ltrim : t -> t

ltrim s trims space on the left (see String.trim for more details).

val rtrim : t -> t

rtrim s trims space on the right (see String.trim for more details).

Operations on 2 strings

val map2 : ( char -> char -> char ) -> string -> string -> string

map2 f s1 s2 maps pairs of chars.

val iter2 : ( char -> char -> unit ) -> string -> string -> unit

iter2 f s1 s2 iterates on pairs of chars.

val iteri2 : ( int -> char -> char -> unit ) -> string -> string -> unit

iteri2 f s1 s2 iterates on pairs of chars with their index.

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

fold2 f init s1 s2 folds on pairs of chars.

val for_all2 : ( char -> char -> bool ) -> string -> string -> bool

for_all2 f s1 s2 returns true iff all pairs of chars satisfy the predicate f.

val exists2 : ( char -> char -> bool ) -> string -> string -> bool

exists2 f s1 s2 returns true iff a pair of chars satisfy the predicate f.

Ascii functions

Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.

val equal_caseless : string -> string -> bool

equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.

val to_hex : string -> string

Convert a string with arbitrary content into a hexadecimal string.

val of_hex : string -> string option

Convert a string in hex into a string with arbitrary content.

val of_hex_exn : string -> string

Same as of_hex but fails harder.

Finding

A relatively efficient algorithm for finding sub-strings.

module Find : sig ... end

Splitting

module Split : sig ... end
val split_on_char : char -> string -> string list

split_on_char by s splits the string s along the given char by.

val split : by:string -> string -> string list

split ~by s splits the string s along the given string by. Alias to Split.list_cpy.

Utils

val compare_versions : string -> string -> int

compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.

val compare_natural : string -> string -> int

compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order

val edit_distance : ?cutoff:int -> string -> string -> int

edit_distance ~cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.

Infix operators

module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file diff --git a/dev/containers/CCStringLabels/index.html b/dev/containers/CCStringLabels/index.html index 4b487b72..12b9fcf8 100644 --- a/dev/containers/CCStringLabels/index.html +++ b/dev/containers/CCStringLabels/index.html @@ -22,4 +22,4 @@ string -> pos:int -> sub_len:int -> - bool

is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.

val repeat : string -> int -> string

repeat s n creates a string by repeating the string s n times.

val prefix : pre:string -> string -> bool

prefix ~pre s returns true iff pre is a prefix of s.

val suffix : suf:string -> string -> bool

suffix ~suf s returns true iff suf is a suffix of s.

val chop_prefix : pre:string -> string -> string option

chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.

val chop_suffix : suf:string -> string -> string option

chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.

val take : int -> string -> string

take n s keeps only the n first chars of s.

val drop : int -> string -> string

drop n s removes the n first chars of s.

val take_drop : int -> string -> string * string

take_drop n s is take n s, drop n s.

val lines : string -> string list

lines s returns a list of the lines of s (splits along '\n').

val lines_gen : string -> string gen

lines_gen s returns a generator gen of the lines of s (splits along '\n').

val lines_iter : string -> string iter

lines_iter s returns the iter of the lines of s (splits along '\n').

val lines_seq : string -> string Stdlib.Seq.t

lines_seq s returns the Seq.t of the lines of s (splits along '\n').

val concat_iter : sep:string -> string iter -> string

concat_iter ~sep iter concatenates all strings of iter, separated with sep.

val concat_gen : sep:string -> string gen -> string

concat_gen ~sep gen concatenates all strings of gen, separated with sep.

val concat_seq : sep:string -> string Stdlib.Seq.t -> string

concat_seq ~sep seq concatenates all strings of seq, separated with sep.

val unlines : string list -> string

unlines ls concatenates all strings of ls, separated with '\n'.

val unlines_gen : string gen -> string

unlines_gen gen concatenates all strings of gen, separated with '\n'.

val unlines_iter : string iter -> string

unlines_iter iter concatenates all strings of iter, separated with '\n'.

val unlines_seq : string Stdlib.Seq.t -> string

unlines_seq seq concatenates all strings of seq, separated with '\n'.

val set : string -> int -> char -> string

set s i c creates a new string which is a copy of s, except for index i, which becomes c.

val iter : f:( char -> unit ) -> string -> unit

iter ~f s applies function f on each character of s. Alias to String.iter.

val filter_map : f:( char -> char option ) -> string -> string

filter_map ~f s calls (f a0) (f a1) … (f an) where a0 … an are the characters of s. It returns the string of characters ci such as f ai = Some ci (when f returns None, the corresponding element of s is discarded).

val filter : f:( char -> bool ) -> string -> string

filter ~f s discards characters of s not satisfying f.

val uniq : eq:( char -> char -> bool ) -> string -> string

uniq ~eq s remove consecutive duplicate characters in s.

val flat_map : ?sep:string -> f:( char -> string ) -> string -> string

flat_map ?sep ~f s maps each chars of s to a string, then concatenates them all.

val for_all : f:( char -> bool ) -> string -> bool

for_all ~f s is true iff all characters of s satisfy the predicate f.

val exists : f:( char -> bool ) -> string -> bool

exists ~f s is true iff some character of s satisfy the predicate f.

val drop_while : f:( char -> bool ) -> t -> t

drop_while ~f s discards any characters of s starting from the left, up to the first character c not satisfying f c.

val rdrop_while : f:( char -> bool ) -> t -> t

rdrop_while ~f s discards any characters of s starting from the right, up to the first character c not satisfying f c.

val ltrim : t -> t

ltrim s trims space on the left (see String.trim for more details).

val rtrim : t -> t

rtrim s trims space on the right (see String.trim for more details).

Operations on 2 strings

val map2 : f:( char -> char -> char ) -> string -> string -> string

map2 ~f s1 s2 maps pairs of chars.

val iter2 : f:( char -> char -> unit ) -> string -> string -> unit

iter2 ~f s1 s2 iterates on pairs of chars.

val iteri2 : f:( int -> char -> char -> unit ) -> string -> string -> unit

iteri2 ~f s1 s2 iterates on pairs of chars with their index.

val fold2 : f:( 'a -> char -> char -> 'a ) -> init:'a -> string -> string -> 'a

fold2 ~f ~init s1 s2 folds on pairs of chars.

val for_all2 : f:( char -> char -> bool ) -> string -> string -> bool

for_all2 ~f s1 s2 returns true iff all pairs of chars satisfy the predicate f.

val exists2 : f:( char -> char -> bool ) -> string -> string -> bool

exists2 ~f s1 s2 returns true iff a pair of chars satisfy the predicate f.

Ascii functions

Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.

val capitalize_ascii : string -> string

capitalize_ascii s returns a copy of s with the first character set to uppercase using the US-ASCII character set. See String.

val uncapitalize_ascii : string -> string

uncapitalize_ascii s returns a copy of s with the first character set to lowercase using the US-ASCII character set. See String.

val uppercase_ascii : string -> string

uppercase_ascii s returns a copy of s with all lowercase letters translated to uppercase using the US-ASCII character set. See String.

val lowercase_ascii : string -> string

lowercase_ascii s returns a copy of s with all uppercase letters translated to lowercase using the US-ASCII character set. See String.

val equal_caseless : string -> string -> bool

equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.

Finding

A relatively efficient algorithm for finding sub-strings.

module Find : sig ... end

Splitting

module Split : sig ... end
val split_on_char : by:char -> string -> string list

split_on_char ~by s splits the string s along the given char by.

val split : by:string -> string -> string list

split ~by s splits the string s along the given string by. Alias to Split.list_cpy.

Utils

val compare_versions : string -> string -> int

compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.

val compare_natural : string -> string -> int

compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order

val edit_distance : ?cutoff:int -> string -> string -> int

edit_distance ?cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.

Infix operators

module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file + bool

is_sub ~sub ~sub_pos s ~pos ~sub_len returns true iff the substring of sub starting at position sub_pos and of length sub_len is a substring of s starting at position pos.

val repeat : string -> int -> string

repeat s n creates a string by repeating the string s n times.

val prefix : pre:string -> string -> bool

prefix ~pre s returns true iff pre is a prefix of s.

val suffix : suf:string -> string -> bool

suffix ~suf s returns true iff suf is a suffix of s.

val chop_prefix : pre:string -> string -> string option

chop_prefix ~pre s removes pre from s if pre really is a prefix of s, returns None otherwise.

val chop_suffix : suf:string -> string -> string option

chop_suffix ~suf s removes suf from s if suf really is a suffix of s, returns None otherwise.

val take : int -> string -> string

take n s keeps only the n first chars of s.

val drop : int -> string -> string

drop n s removes the n first chars of s.

val take_drop : int -> string -> string * string

take_drop n s is take n s, drop n s.

val lines : string -> string list

lines s returns a list of the lines of s (splits along '\n').

val lines_gen : string -> string gen

lines_gen s returns a generator gen of the lines of s (splits along '\n').

val lines_iter : string -> string iter

lines_iter s returns the iter of the lines of s (splits along '\n').

val lines_seq : string -> string Stdlib.Seq.t

lines_seq s returns the Seq.t of the lines of s (splits along '\n').

val concat_iter : sep:string -> string iter -> string

concat_iter ~sep iter concatenates all strings of iter, separated with sep.

val concat_gen : sep:string -> string gen -> string

concat_gen ~sep gen concatenates all strings of gen, separated with sep.

val concat_seq : sep:string -> string Stdlib.Seq.t -> string

concat_seq ~sep seq concatenates all strings of seq, separated with sep.

val unlines : string list -> string

unlines ls concatenates all strings of ls, separated with '\n'.

val unlines_gen : string gen -> string

unlines_gen gen concatenates all strings of gen, separated with '\n'.

val unlines_iter : string iter -> string

unlines_iter iter concatenates all strings of iter, separated with '\n'.

val unlines_seq : string Stdlib.Seq.t -> string

unlines_seq seq concatenates all strings of seq, separated with '\n'.

val set : string -> int -> char -> string

set s i c creates a new string which is a copy of s, except for index i, which becomes c.

val iter : f:( char -> unit ) -> string -> unit

iter ~f s applies function f on each character of s. Alias to String.iter.

val filter_map : f:( char -> char option ) -> string -> string

filter_map ~f s calls (f a0) (f a1) … (f an) where a0 … an are the characters of s. It returns the string of characters ci such as f ai = Some ci (when f returns None, the corresponding element of s is discarded).

val filter : f:( char -> bool ) -> string -> string

filter ~f s discards characters of s not satisfying f.

val uniq : eq:( char -> char -> bool ) -> string -> string

uniq ~eq s remove consecutive duplicate characters in s.

val flat_map : ?sep:string -> f:( char -> string ) -> string -> string

flat_map ?sep ~f s maps each chars of s to a string, then concatenates them all.

val for_all : f:( char -> bool ) -> string -> bool

for_all ~f s is true iff all characters of s satisfy the predicate f.

val exists : f:( char -> bool ) -> string -> bool

exists ~f s is true iff some character of s satisfy the predicate f.

val drop_while : f:( char -> bool ) -> t -> t

drop_while ~f s discards any characters of s starting from the left, up to the first character c not satisfying f c.

val rdrop_while : f:( char -> bool ) -> t -> t

rdrop_while ~f s discards any characters of s starting from the right, up to the first character c not satisfying f c.

val ltrim : t -> t

ltrim s trims space on the left (see String.trim for more details).

val rtrim : t -> t

rtrim s trims space on the right (see String.trim for more details).

Operations on 2 strings

val map2 : f:( char -> char -> char ) -> string -> string -> string

map2 ~f s1 s2 maps pairs of chars.

val iter2 : f:( char -> char -> unit ) -> string -> string -> unit

iter2 ~f s1 s2 iterates on pairs of chars.

val iteri2 : f:( int -> char -> char -> unit ) -> string -> string -> unit

iteri2 ~f s1 s2 iterates on pairs of chars with their index.

val fold2 : f:( 'a -> char -> char -> 'a ) -> init:'a -> string -> string -> 'a

fold2 ~f ~init s1 s2 folds on pairs of chars.

val for_all2 : f:( char -> char -> bool ) -> string -> string -> bool

for_all2 ~f s1 s2 returns true iff all pairs of chars satisfy the predicate f.

val exists2 : f:( char -> char -> bool ) -> string -> string -> bool

exists2 ~f s1 s2 returns true iff a pair of chars satisfy the predicate f.

Ascii functions

Those functions are deprecated in String since 4.03, so we provide a stable alias for them even in older versions.

val capitalize_ascii : string -> string

capitalize_ascii s returns a copy of s with the first character set to uppercase using the US-ASCII character set. See String.

val uncapitalize_ascii : string -> string

uncapitalize_ascii s returns a copy of s with the first character set to lowercase using the US-ASCII character set. See String.

val uppercase_ascii : string -> string

uppercase_ascii s returns a copy of s with all lowercase letters translated to uppercase using the US-ASCII character set. See String.

val lowercase_ascii : string -> string

lowercase_ascii s returns a copy of s with all uppercase letters translated to lowercase using the US-ASCII character set. See String.

val equal_caseless : string -> string -> bool

equal_caseless s1 s2 compares s1 and s2 without respect to ascii lowercase.

val to_hex : string -> string

Convert a string with arbitrary content into a hexadecimal string.

val of_hex : string -> string option

Convert a string in hex into a string with arbitrary content.

val of_hex_exn : string -> string

Same as of_hex but fails harder.

Finding

A relatively efficient algorithm for finding sub-strings.

module Find : sig ... end

Splitting

module Split : sig ... end
val split_on_char : by:char -> string -> string list

split_on_char ~by s splits the string s along the given char by.

val split : by:string -> string -> string list

split ~by s splits the string s along the given string by. Alias to Split.list_cpy.

Utils

val compare_versions : string -> string -> int

compare_versions s1 s2 compares version strings s1 and s2, considering that numbers are above text.

val compare_natural : string -> string -> int

compare_natural s1 s2 is the Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order

val edit_distance : ?cutoff:int -> string -> string -> int

edit_distance ?cutoff s1 s2 is the edition distance between the two strings s1 and s2. This satisfies the classical distance axioms: it is always positive, symmetric, and satisfies the formula distance s1 s2 + distance s2 s3 >= distance s1 s3.

Infix operators

module Infix : sig ... end
include module type of Infix
val (=) : t -> t -> bool
  • since 3.0
val (<>) : t -> t -> bool
  • since 3.0
val (<) : t -> t -> bool
  • since 3.0
val (<=) : t -> t -> bool
  • since 3.0
val (>=) : t -> t -> bool
  • since 3.0
val (>) : t -> t -> bool
  • since 3.0
\ No newline at end of file