Updated String and StringLabels interfaces to reflect take_while, rtake_while.

This commit is contained in:
Alexander Lucas 2025-01-01 09:34:06 -05:00
parent 85ca948012
commit 699b370220
2 changed files with 14 additions and 2 deletions

View file

@ -184,11 +184,13 @@ val take : int -> string -> string
val take_while : (char -> bool) -> string -> string
(** [take_while p s] keeps only the longest prefix [t] of [s] such that every
character [c] in [t] satisfies [p c]. *)
character [c] in [t] satisfies [p c].
@since 3.16 *)
val rtake_while : (char -> bool) -> string -> string
(** [rtake_while p s] keeps only the longest suffix [t] of [s] such that every
character [c] in [t] satisfies [p c]. *)
character [c] in [t] satisfies [p c].
@since 3.16 *)
val drop : int -> string -> string
(** [drop n s] removes the [n] first chars of [s].

View file

@ -193,6 +193,16 @@ val take : int -> string -> string
(** [take n s] keeps only the [n] first chars of [s].
@since 0.17 *)
val take_while : p:(char -> bool) -> string -> string
(** [take_while ~p s] keeps only the longest prefix [t] of [s] such that every
character [c] in [t] satisfies [p c].
@since 3.16 *)
val rtake_while : p:(char -> bool) -> string -> string
(** [rtake_while ~p s] keeps only the longest suffix [t] of [s] such that every
character [c] in [t] satisfies [p c].
@since 3.16 *)
val drop : int -> string -> string
(** [drop n s] removes the [n] first chars of [s].
@since 0.17 *)