Add String.is_empty

This commit is contained in:
Jacques-Pascal Deplaix 2017-12-01 08:36:14 +00:00
parent c66c96d252
commit e20d0ccfcc
2 changed files with 5 additions and 0 deletions

View file

@ -52,6 +52,8 @@ let init = String.init
let length = String.length
let is_empty s = equal s ""
let rev s =
let n = length s in
init n (fun i -> s.[n-i-1])

View file

@ -54,6 +54,9 @@ val equal : string -> string -> bool
val compare : string -> string -> int
val is_empty : string -> bool
(** @since NEXT_RELEASE *)
val hash : string -> int
val init : int -> (int -> char) -> string