aboutsummaryrefslogtreecommitdiff
path: root/clib/cString.ml
diff options
context:
space:
mode:
authorHugo Herbelin2019-04-05 19:53:48 +0200
committerHugo Herbelin2019-09-10 12:05:32 +0200
commitf612bee8c1723b4d66fe1ba93dbb23f5bd201ae6 (patch)
tree454cd553f1eb1c11e096162c8c8ac62e830ea0e2 /clib/cString.ml
parentd338a42c261287439dd6e9bc07b40a68f2a71786 (diff)
Moving a standard string function (is_prefix) from Minilib to CString.
Diffstat (limited to 'clib/cString.ml')
-rw-r--r--clib/cString.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/clib/cString.ml b/clib/cString.ml
index 60915efe86..99fb7d2b78 100644
--- a/clib/cString.ml
+++ b/clib/cString.ml
@@ -24,6 +24,7 @@ sig
val conjugate_verb_to_be : int -> string
val ordinal : int -> string
val is_sub : string -> string -> int -> bool
+ val is_prefix : string -> string -> bool
module Set : Set.S with type elt = t
module Map : CMap.ExtS with type key = t and module Set := Set
module List : CList.MonoS with type elt = t
@@ -101,6 +102,9 @@ let is_sub p s off =
in
aux 0
+let is_prefix p s =
+ is_sub p s 0
+
let plural n s = if n<>1 then s^"s" else s
let conjugate_verb_to_be n = if n<>1 then "are" else "is"