package devkit

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

Module Devkit_core.StreSource

More string functions

Sourceval by_words : Pcre.regexp
Sourceval by_space : Pcre.regexp
Sourceval by_lines : Pcre.regexp
Sourceval split : Pcre.regexp -> string -> string list
Sourceval nsplitc_enum : string -> char -> string Devkit_core.Prelude.Enum.t
Sourceval nsplitc_fold : string -> char -> ('a -> string -> 'a) -> 'a -> 'a
Sourceval nsplitc_rev : string -> char -> string list
Sourceval nsplitc : string -> char -> string list
Sourceval countc : string -> char -> int
Sourceval from_to : string -> int -> int -> string

from_to s a b

  • returns

    substring of s from position a (including) up to position b (excluding).

Sourceval unsafe_from_to : string -> int -> int -> string

from_to without safety checks

Sourceval upto : string -> int -> string

upto s p

  • returns

    prefix of s up to position p (excluding)

Sourceval from : string -> int -> string

from s p

  • returns

    suffix of s from position p (including)

Sourceval slice : ?first:int -> ?last:int -> string -> string

safe (lazy) way to cut substring same as extlib String.slice

Sourceval splitc : string -> char -> string * string

split by delimiter

Sourceval rsplitc : string -> char -> string * string

split by delimiter from the right

Sourceval before : string -> string -> string

before s sep

  • returns

    substring from the beginning of s to the delimiter sep or the original string if delimiter is not present. NB before s "" -> "" e.g. before "a.b.c" "." -> "a"

Sourceval after : string -> string -> string
  • returns

    substring from the delimiter sep to the end of string s or the empty string if delimiter is not present. e.g. after "a.b.c" "." -> "b.c" NB after s "" -> s invariant: if s contains sep then before s sep ^ sep ^ after s sep = s else before s sep ^ after s sep = s or put it another way: say a = before s sep and b = after s sep then before (a ^ sep ^ b) sep = a and after (a ^ sep ^ b) sep = b

Sourceval divide : string -> string -> string * string
  • returns

    (before s sep, after s sep) divide s sep is equal to String.split but doesn't throw if sep is not a substring of s

Sourceval dividec : string -> char -> string * string
Sourceval qreplace : string -> string -> string -> string
Sourceval replace_all : str:string -> sub:string -> by:string -> string
Sourceval extract : Pcre.regexp -> string -> string option

contents of the first submatch

Sourceval starts_with : string -> ?pos:int -> string -> bool

String.starts_with but with pos to start from

Sourceval ends_with : string -> string -> bool
Sourceval exists : string -> string -> bool
Sourceval drop_prefix : string -> string -> string

remove prefix from string if present

Sourceval drop_suffix : string -> string -> string
Sourceval istarts_with : string -> ?pos:int -> string -> bool
Sourceval iequal : string -> string -> bool

ascii case-insensitive equality

Sourceval equal : string -> string -> bool
Sourceval iexists : string -> string -> bool

ascii case-insensitive substring

sequence of matches

Sourceval enum_extract : Pcre.regexp -> string -> string Devkit_core.Prelude.Enum.t
Sourcemodule ASCII : sig ... end
Sourceval rev : string -> string
Sourceval common_prefix : string -> string -> int
Sourceval shorten : ?escape:bool -> int -> string -> string
Sourceval array_concat : string -> string array -> string
Sourceval rstrip : ?chars:string -> string -> string
Sourceval catmap : ?sep:string -> ('a -> string) -> 'a list -> string
Sourceval list : ('a -> string) -> 'a list -> string
Sourceval array : ('a -> string) -> 'a array -> string
OCaml

Innovation. Community. Security.