add CCstring.of_char

This commit is contained in:
Simon Cruanes 2016-06-17 11:54:30 +02:00
parent 9c76572e83
commit 103dfb8c73
2 changed files with 6 additions and 0 deletions

View file

@ -475,6 +475,8 @@ let _to_gen s i0 len =
let to_gen s = _to_gen s 0 (String.length s)
let of_char c = String.make 1 c
let of_gen g =
let b = Buffer.create 32 in
let rec aux () = match g () with

View file

@ -94,6 +94,10 @@ val pad : ?side:[`Left|`Right] -> ?c:char -> int -> string -> string
"aaa" (pad ~side:`Right ~c:'a' 3 "")
*)
val of_char : char -> string
(** [of_char 'a' = "a"]
@since NEXT_RELEASE *)
val of_gen : char gen -> string
val of_seq : char sequence -> string
val of_klist : char klist -> string