Skip to content

Commit 480004b

Browse files
committed
Update Js.String and Js.String2 examples
1 parent 71ef4c4 commit 480004b

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

jscomp/others/js_string.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ external concatMany : t array -> t = "concat" [@@bs.send.pipe: t] [@@bs.splice]
148148
[endsWith substr str] returns [true] if the [str] ends with [substr], [false] otherwise.
149149
150150
@example {[
151-
endsWith "Script" "BuckleScript" = true;;
152-
endsWith "Script" "BuckleShoes" = false;;
151+
endsWith "Script" "ReScript" = true;;
152+
endsWith "Script" "ReShoes" = false;;
153153
]}
154154
*)
155155
external endsWith : t -> bool = "endsWith" [@@bs.send.pipe: t]
@@ -506,9 +506,9 @@ external splitRegexpLimited : Js_re.t -> int -> t array = "split" [@@bs.send.pi
506506
[startsWith substr str] returns [true] if the [str] starts with [substr], [false] otherwise.
507507
508508
@example {[
509-
startsWith "Buckle" "BuckleScript" = true;;
510-
startsWith "" "BuckleScript" = true;;
511-
startsWith "Buckle" "JavaScript" = false;;
509+
startsWith "Re" "ReScript" = true;;
510+
startsWith "" "ReScript" = true;;
511+
startsWith "Re" "JavaScript" = false;;
512512
]}
513513
*)
514514
external startsWith : t -> bool = "startsWith" [@@bs.send.pipe: t]
@@ -517,9 +517,9 @@ external startsWith : t -> bool = "startsWith" [@@bs.send.pipe: t]
517517
[startsWithFrom substr n str] returns [true] if the [str] starts with [substr] starting at position [n], [false] otherwise. If [n] is negative, the search starts at the beginning of [str].
518518
519519
@example {[
520-
startsWithFrom "kle" 3 "BuckleScript" = true;;
521-
startsWithFrom "" 3 "BuckleScript" = true;;
522-
startsWithFrom "Buckle" 2 "JavaScript" = false;;
520+
startsWithFrom "cri" 3 "ReScript" = true;;
521+
startsWithFrom "" 3 "ReScript" = true;;
522+
startsWithFrom "Re" 2 "JavaScript" = false;;
523523
]}
524524
*)
525525
external startsWithFrom : t -> int -> bool = "startsWith" [@@bs.send.pipe: t]

jscomp/others/js_string2.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ external concatMany : t -> t array -> t = "concat" [@@bs.send] [@@bs.splice]
148148
[endsWith substr str] returns [true] if the [str] ends with [substr], [false] otherwise.
149149
150150
@example {[
151-
endsWith "BuckleScript" "Script" = true;;
152-
endsWith "BuckleShoes" "Script" = false;;
151+
endsWith "ReScript" "Script" = true;;
152+
endsWith "ReShoes" "Script" = false;;
153153
]}
154154
*)
155155
external endsWith : t -> t -> bool = "endsWith" [@@bs.send]
@@ -491,9 +491,9 @@ external splitByReAtMost : t -> Js_re.t -> limit:int -> t option array = "split
491491
[startsWith substr str] returns [true] if the [str] starts with [substr], [false] otherwise.
492492
493493
@example {[
494-
startsWith "BuckleScript" "Buckle" = true;;
495-
startsWith "BuckleScript" "" = true;;
496-
startsWith "JavaScript" "Buckle" = false;;
494+
startsWith "ReScript" "Re" = true;;
495+
startsWith "ReScript" "" = true;;
496+
startsWith "JavaScript" "Re" = false;;
497497
]}
498498
*)
499499
external startsWith : t -> t -> bool = "startsWith" [@@bs.send]
@@ -502,9 +502,9 @@ external startsWith : t -> t -> bool = "startsWith" [@@bs.send]
502502
[startsWithFrom substr n str] returns [true] if the [str] starts with [substr] starting at position [n], [false] otherwise. If [n] is negative, the search starts at the beginning of [str].
503503
504504
@example {[
505-
startsWithFrom "BuckleScript" "kle" 3 = true;;
506-
startsWithFrom "BuckleScript" "" 3 = true;;
507-
startsWithFrom "JavaScript" "Buckle" 2 = false;;
505+
startsWithFrom "ReScript" "cri" 3 = true;;
506+
startsWithFrom "ReScript" "" 3 = true;;
507+
startsWithFrom "JavaScript" "Re" 2 = false;;
508508
]}
509509
*)
510510
external startsWithFrom : t -> t -> int -> bool = "startsWith" [@@bs.send]

0 commit comments

Comments
 (0)