You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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].
518
518
519
519
@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;;
523
523
]}
524
524
*)
525
525
external startsWithFrom : t -> int -> bool = "startsWith" [@@bs.send.pipe: t]
Copy file name to clipboardExpand all lines: jscomp/others/js_string2.ml
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -148,8 +148,8 @@ external concatMany : t -> t array -> t = "concat" [@@bs.send] [@@bs.splice]
148
148
[endsWith substr str] returns [true] if the [str] ends with [substr], [false] otherwise.
149
149
150
150
@example {[
151
-
endsWith "BuckleScript" "Script" = true;;
152
-
endsWith "BuckleShoes" "Script" = false;;
151
+
endsWith "ReScript" "Script" = true;;
152
+
endsWith "ReShoes" "Script" = false;;
153
153
]}
154
154
*)
155
155
external endsWith : t -> t -> bool = "endsWith" [@@bs.send]
@@ -491,9 +491,9 @@ external splitByReAtMost : t -> Js_re.t -> limit:int -> t option array = "split
491
491
[startsWith substr str] returns [true] if the [str] starts with [substr], [false] otherwise.
492
492
493
493
@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;;
497
497
]}
498
498
*)
499
499
external startsWith : t -> t -> bool = "startsWith" [@@bs.send]
@@ -502,9 +502,9 @@ external startsWith : t -> t -> bool = "startsWith" [@@bs.send]
502
502
[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].
503
503
504
504
@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;;
508
508
]}
509
509
*)
510
510
external startsWithFrom : t -> t -> int -> bool = "startsWith" [@@bs.send]
0 commit comments