Module Js.String

module String: Js_string

type t = string 
val make : 'a -> t
val fromCharCode : int -> t
val fromCharCodeMany : int array -> t
val fromCodePoint : int -> t
val fromCodePointMany : int array -> t
ES2015

ES2015
val length : t -> int
val get : t -> int -> t
val charAt : int -> t -> t
val charCodeAt : int -> t -> float
val codePointAt : int -> t -> int option
type it as float due to that it may return NAN different from charCodeAt
        "\u{01003f}".charCodeAt(0) - 55296
        "\u{01003f}".codePointAt(0) - 65599
    


ES2015
val concat : t -> t -> t
val concatMany : t array -> t -> t
val endsWith : t -> t -> bool
val endsWithFrom : t -> int -> t -> bool
ES2015

ES2015
val includes : t -> t -> bool
val includesFrom : t -> int -> t -> bool
ES2015

ES2015
val indexOf : t -> t -> int
val indexOfFrom : t -> int -> t -> int
val lastIndexOf : t -> t -> int
val lastIndexOfFrom : t -> int -> t -> int
val localeCompare : t -> t -> float
val match_ : Js_re.t -> t -> t array option
val normalize : t -> t
val normalizeByForm : t -> t -> t
ES2015

ES2015
val repeat : int -> t -> t

ES2015
val replace : t -> t -> t -> t
val replaceByRe : Js_re.t -> t -> t -> t
val unsafeReplaceBy0 : Js_re.t ->
(t -> int -> t -> t) ->
t -> t
returns a new string with some or all matches of a pattern replaced by the value returned from the given function
See also MDN
let str = "hello world!"
let re = [%re "/hello/g"]
let replaced = Js.String.unsafeReplaceBy0 re (fun match offset whole -> "hi")

let () = Js.log replaced (* prints "hi world!" *)
val unsafeReplaceBy1 : Js_re.t ->
(t -> t -> int -> t -> t) ->
t -> t
returns a new string with some or all matches of a pattern replaced by the value returned from the given function
See also MDN
let str = "hello world!"
let re = [%re "/hello/g"]
let replaced = Js.String.unsafeReplaceBy1 re (fun match p1 offset whole -> "hi")

let () = Js.log replaced (* prints "hi world!" *)
val unsafeReplaceBy2 : Js_re.t ->
(t ->
t -> t -> int -> t -> t) ->
t -> t
returns a new string with some or all matches of a pattern replaced by the value returned from the given function
See also MDN
let str = "hello world!"
let re = [%re "/hello/g"]
let replaced = Js.String.unsafeReplaceBy2 re (fun match p1 p2 offset whole -> "hi")

let () = Js.log replaced (* prints "hi world!" *)
val unsafeReplaceBy3 : Js_re.t ->
(t ->
t ->
t -> t -> int -> t -> t) ->
t -> t
returns a new string with some or all matches of a pattern replaced by the value returned from the given function
See also MDN
let str = "hello world!"
let re = [%re "/hello/g"]
let replaced = Js.String.unsafeReplaceBy3 re (fun match p1 p2 p3 offset whole -> "hi")

let () = Js.log replaced (* prints "hi world!" *)
val search : Js_re.t -> t -> int
val slice : from:int -> to_:int -> t -> t
val sliceToEnd : from:int -> t -> t
val split : t -> t -> t array
val splitAtMost : t -> limit:int -> t -> t array
val splitLimited : t -> int -> t -> t array
val splitByRe : Js_re.t -> t -> t array
val splitByReAtMost : Js_re.t -> limit:int -> t -> t array
val splitRegexpLimited : Js_re.t -> int -> t -> t array
val startsWith : t -> t -> bool
val startsWithFrom : t -> int -> t -> bool
ES2015

ES2015
val substr : from:int -> t -> t
val substrAtMost : from:int -> length:int -> t -> t
val substring : from:int -> to_:int -> t -> t
val substringToEnd : from:int -> t -> t
val toLowerCase : t -> t
val toLocaleLowerCase : t -> t
val toUpperCase : t -> t
val toLocaleUpperCase : t -> t
val trim : t -> t
val anchor : t -> t -> t
val link : t -> t -> t
ES2015

ES2015
val castToArrayLike : t -> t Js_array.array_like