CCString.init

This commit is contained in:
Simon Cruanes 2014-07-11 23:07:26 +02:00
parent 4ca1295c44
commit 783331b037
2 changed files with 9 additions and 0 deletions

View file

@ -56,6 +56,11 @@ let compare = String.compare
let hash s = Hashtbl.hash s
let init n f =
let s = String.make n ' ' in
for i = 0 to n-1 do s.[i] <- f i done;
s
let length = String.length
let rec _to_list s acc i len =

View file

@ -62,6 +62,10 @@ val compare : t -> t -> int
val hash : t -> int
val init : int -> (int -> char) -> t
(** Analog to [Array.init].
@since NEXT_VERSION *)
val of_gen : char gen -> t
val of_seq : char sequence -> t
val of_klist : char klist -> t