diff options
Diffstat (limited to 'lib/cString.mli')
| -rw-r--r-- | lib/cString.mli | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/cString.mli b/lib/cString.mli index 1d33cef39b..9f4a47f19d 100644 --- a/lib/cString.mli +++ b/lib/cString.mli @@ -47,17 +47,46 @@ end module type ExtS = sig include S + (** We include the standard library *) + external equal : string -> string -> bool = "caml_string_equal" "noalloc" + (** Equality on strings *) + + val is_empty : string -> bool + (** Test whether a string is empty. *) + val explode : string -> string list + (** [explode "x1...xn"] returns [["x1"; ...; "xn"]] *) + val implode : string list -> string + (** [implode [s1; ...; sn]] returns [s1 ^ ... ^ sn] *) + val strip : string -> string + (** Remove the surrounding blank characters from a string *) + val map : (char -> char) -> string -> string + (** Apply a function on a string character-wise. *) + val drop_simple_quotes : string -> string + (** Remove the eventual first surrounding simple quotes of a string. *) + val string_index_from : string -> int -> string -> int + (** As [index_from], but takes a string instead of a char as pattern argument *) + val string_contains : where:string -> what:string -> bool + (** As [contains], but takes a string instead of a char as pattern argument *) + val plural : int -> string -> string + (** [plural n s] adds a optional 's' to the [s] when [2 <= n]. *) + val ordinal : int -> string + (** Generate the ordinal number in English. *) + val split : char -> string -> string list + (** [split c s] splits [s] into sequences separated by [c], excluded. *) + + val is_sub : string -> string -> int -> bool + (** [is_sub p s off] tests whether [s] contains [p] at offset [off]. *) end include ExtS |
