From 1498158a4fdd2b94f5ed752db7646a95461ad406 Mon Sep 17 00:00:00 2001 From: mobotsar Date: Wed, 1 Jan 2025 00:47:17 -0500 Subject: [PATCH] Update CCString.mli for take_while, rtake_while --- src/core/CCString.mli | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/CCString.mli b/src/core/CCString.mli index 0e5e7ba0..519c42a5 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -182,6 +182,14 @@ val take : int -> string -> string (** [take n s] keeps only the [n] first chars of [s]. @since 0.17 *) +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 [f c]. *) + +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 [f c]. *) + val drop : int -> string -> string (** [drop n s] removes the [n] first chars of [s]. @since 0.17 *)