Module Loko.String

val ends_with : Stdlib.String.t -> ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

A prism that focuses on the prefix of a string that ends with the given suffix.

val escaped : ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

An isomorphism that escapes on read and unescapes on write.

let "'\\t' vs ' '" = L.view L.String.escaped "'\t' vs ' '"
val split_on_char : char -> ( Stdlib.String.t, Stdlib.String.t list, Stdlib.String.t list, Stdlib.String.t ) optic

An isomorphism between separated string and list of strings.

let "One:Two:Three" =
  L.over (L.String.split_on_char ':' ^<< L.List.elems)
    String.capitalize_ascii
    "one:two:three"
val starts_with : Stdlib.String.t -> ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

A prism that focuses on the suffix of a string that starts with the given prefix.

val sub : int -> int -> ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

sub pos len is a lens that focuses on the substring that starts at specified position and has given length.

let "Loko" = L.set (L.String.sub 1 3) "ok" "Lasso"
val trim : ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

An isomorphism that trims the string in both directions.

val unescaped : ( Stdlib.String.t, Stdlib.String.t, Stdlib.String.t, Stdlib.String.t ) optic

An isomorphism that unescapes on read and escapes on write.