Module Brr.Str

module Str: sig .. end
JavaScript strings.


Strings


type t = Brr.str 
The type for JavaScript strings.
val empty : Brr.str
empty is an empty string.
val is_empty : Brr.str -> bool
is_empty s is true iff s is an empty string.
val append : Brr.str -> Brr.str -> Brr.str
append s0 s1 appends s1 to s0.
val cuts : sep:Brr.str -> Brr.str -> Brr.str list
cuts sep s is the list of all (possibly empty) substrings of s that are delimited by matches of the non empty separator string sep.
val concat : sep:Brr.str -> Brr.str list -> Brr.str
concat sep ss is the concatenates the list of strings ss inserting sep between each of them.
val slice : ?start:int -> ?stop:int -> Brr.str -> Brr.str
slice ~start ~stop s is the string s.start, s.start+1, ... s.stop - 1. start defaults to 0 and stop to String.length s.

If start or stop are negative they are subtracted from String.length s. This means that -1 denotes the last character of the string.

val trim : Brr.str -> Brr.str
trim s is s without whitespace from the beginning and end of the string.
val chop : prefix:Brr.str -> Brr.str -> Brr.str option
chop prefix s is s without the prefix prefix or None if prefix is not a prefix of s.
val rchop : suffix:Brr.str -> Brr.str -> Brr.str option
rchop suffix s is s without the suffix suffix or None if suffix is not a suffix of s.
val to_string : Brr.str -> string
to_string s is s as an OCaml string.
val of_string : string -> Brr.str
of_string s is the OCaml string s as a JavaScript string.
val equal : Brr.str -> Brr.str -> bool
equal s0 s1 is true iff s0 and s1 are equal.
val compare : Brr.str -> Brr.str -> int
compare s0 s1 is a total order on strings compatible with Brr.Str.equal.
val pp : Format.formatter -> Brr.str -> unit
pp ppf s prints s on ppf.